linux/drivers/edac
Kees Cook 189f164e57 Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses
Conversion performed via this Coccinelle script:

  // SPDX-License-Identifier: GPL-2.0-only
  // Options: --include-headers-for-types --all-includes --include-headers --keep-comments
  virtual patch

  @gfp depends on patch && !(file in "tools") && !(file in "samples")@
  identifier ALLOC = {kmalloc_obj,kmalloc_objs,kmalloc_flex,
 		    kzalloc_obj,kzalloc_objs,kzalloc_flex,
		    kvmalloc_obj,kvmalloc_objs,kvmalloc_flex,
		    kvzalloc_obj,kvzalloc_objs,kvzalloc_flex};
  @@

  	ALLOC(...
  -		, GFP_KERNEL
  	)

  $ make coccicheck MODE=patch COCCI=gfp.cocci

Build and boot tested x86_64 with Fedora 42's GCC and Clang:

Linux version 6.19.0+ (user@host) (gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7), GNU ld version 2.44-12.fc42) #1 SMP PREEMPT_DYNAMIC 1970-01-01
Linux version 6.19.0+ (user@host) (clang version 20.1.8 (Fedora 20.1.8-4.fc42), LLD 20.1.8) #1 SMP PREEMPT_DYNAMIC 1970-01-01

Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-22 08:26:33 -08:00
..
a72_edac.c EDAC: Add EDAC driver for ARM Cortex A72 cores 2025-08-15 23:37:00 +02:00
al_mc_edac.c EDAC/al_mc: Make use of the helper function devm_add_action_or_reset() 2021-09-28 18:35:11 +02:00
altera_edac.c EDAC/altera: Remove IRQF_ONESHOT 2026-02-01 17:37:15 +01:00
altera_edac.h EDAC/altera: Set DDR and SDMMC interrupt mask before registration 2025-04-28 12:38:53 +02:00
amd64_edac.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
amd64_edac.h EDAC/amd64: Remove NUM_CONTROLLERS macro 2025-11-06 12:51:33 +01:00
amd76x_edac.c EDAC: Do not issue useless debug statements in the polling routine 2020-10-26 12:59:56 +01:00
armada_xp_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
aspeed_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
bluefield_edac.c EDAC/bluefield: Don't use bluefield_edac_readl() result on error 2025-05-22 17:58:28 +02:00
cpc925_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
debugfs.c EDAC: Use string choice helper functions 2025-02-25 22:19:55 +01:00
dmc520_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
e7xxx_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
e752x_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
ecs.c EDAC: Fix wrong executable file modes for C source files 2025-08-30 17:23:06 +02:00
edac_device.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
edac_device.h EDAC: Remove unused struct members 2024-03-27 18:26:58 +01:00
edac_device_sysfs.c EDAC/device: Remove edac_dev_sysfs_block_attribute::store() 2024-03-27 18:26:57 +01:00
edac_mc.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
edac_mc.h EDAC/mc: Determine mci pointer from the error descriptor 2020-02-17 13:05:10 +01:00
edac_mc_sysfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
edac_module.c EDAC: constantify the struct bus_type usage 2024-01-04 14:34:27 +01:00
edac_module.h EDAC/device: Fix period calculation in edac_device_reset_delay_period() 2022-12-30 15:51:41 +01:00
edac_pci.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
edac_pci.h EDAC: Remove unused struct members 2024-03-27 18:26:58 +01:00
edac_pci_sysfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fsl_ddr_edac.c EDAC/fsl_ddr: Add support for i.MX9 DDR controller 2024-10-23 16:53:55 +02:00
fsl_ddr_edac.h EDAC/fsl_ddr: Add support for i.MX9 DDR controller 2024-10-23 16:53:55 +02:00
ghes_edac.c EDAC/ghes: Replace deprecated strcpy() in ghes_edac_report_mem_error() 2025-11-18 16:50:32 +01:00
highbank_l2_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
highbank_mc_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
i7core_edac.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
i10nm_base.c EDAC/{skx_common,skx,i10nm}: Make skx_register_mci() independent of pci_dev 2025-11-19 12:11:40 -08:00
i3000_edac.c EDAC: Do not issue useless debug statements in the polling routine 2020-10-26 12:59:56 +01:00
i3200_edac.c EDAC/i3200: Fix a resource leak in i3200_probe1() 2026-01-04 08:31:44 +01:00
i5000_edac.c EDAC/i5000: Fix snprintf() size calculation in calculate_dimm_size() 2025-12-17 09:59:17 -08:00
i5100_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
i5400_edac.c EDAC/i5400: Fix snprintf() limit calculation in calculate_dimm_size() 2025-12-17 10:00:20 -08:00
i7300_edac.c EDAC: Use string choice helper functions 2025-02-25 22:19:55 +01:00
i82860_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
i82875p_edac.c EDAC: Do not issue useless debug statements in the polling routine 2020-10-26 12:59:56 +01:00
i82975x_edac.c EDAC: Do not issue useless debug statements in the polling routine 2020-10-26 12:59:56 +01:00
ie31200_edac.c bitmap updates for v6.19 2025-12-06 09:01:27 -08:00
igen6_edac.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
imh_base.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig EDAC/r82600: Remove this obsolete driver 2026-01-30 13:41:32 +01:00
layerscape_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
loongson_edac.c EDAC: Add an EDAC driver for the Loongson memory controller 2025-01-04 12:02:04 +01:00
Makefile EDAC/r82600: Remove this obsolete driver 2026-01-30 13:41:32 +01:00
mce_amd.c x86/msr: Add explicit includes of <asm/msr.h> 2025-05-02 10:23:47 +02:00
mce_amd.h x86/mce/amd, edac: Remove report_gart_errors 2020-04-14 15:53:46 +02:00
mem_repair.c EDAC: Fix wrong executable file modes for C source files 2025-08-30 17:23:06 +02:00
mpc85xx_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
mpc85xx_edac.h treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_56.RULE (part 2) 2022-06-10 14:51:35 +02:00
npcm_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
octeon_edac-l2c.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
octeon_edac-lmc.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
octeon_edac-pc.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
octeon_edac-pci.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
pasemi_edac.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333 2019-06-05 17:37:06 +02:00
pnd2_edac.c EDAC/pnd2: Make read-only const array intlv static 2025-03-03 16:39:26 +01:00
pnd2_edac.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
qcom_edac.c EDAC/qcom: Correct interrupt enable register configuration 2025-02-14 20:36:11 +01:00
sb_edac.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
scrub.c EDAC: Fix wrong executable file modes for C source files 2025-08-30 17:23:06 +02:00
sifive_edac.c EDAC: Remove dynamic attributes from edac_device_alloc_ctl_info() 2024-03-27 18:26:58 +01:00
skx_base.c EDAC/{skx_common,skx,i10nm}: Make skx_register_mci() independent of pci_dev 2025-11-19 12:11:40 -08:00
skx_common.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
skx_common.h EDAC/{skx_comm,imh}: Detect 2-level memory configuration 2025-11-21 10:20:51 -08:00
synopsys_edac.c EDAC/synopsys: Clear the ECC counters on init 2025-07-14 12:15:37 +02:00
thunderx_edac.c EDAC/thunderx: Remove unused struct error_syndrome 2024-05-27 14:42:04 +02:00
ti_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
versal_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
versalnet_edac.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
wq.c EDAC/wq: Remove unneeded flush_workqueue() 2022-08-25 10:50:35 +02:00
x38_edac.c EDAC/x38: Fix a resource leak in x38_probe1() 2026-01-04 08:35:39 +01:00
xgene_edac.c EDAC: Use string choice helper functions 2025-02-25 22:19:55 +01:00
zynqmp_edac.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00