linux/drivers/tty/serial
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
..
8250 Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
jsm Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
21285.c
Kconfig serial: SH_SCI: improve "DMA support" prompt 2026-01-16 14:25:16 +01:00
Makefile serial: sh-sci: Add support for RZ/T2H SCI 2025-07-09 13:45:30 +02:00
altera_jtaguart.c
altera_uart.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
amba-pl010.c
amba-pl011.c serial: amba-pl011: prefer dma_mapping_error() over explicit address checking 2025-10-28 15:26:47 +01:00
apbuart.c
apbuart.h
ar933x_uart.c serial: ar933x: Add polling support 2025-10-22 12:04:43 +02:00
arc_uart.c
atmel_serial.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
atmel_serial.h
bcm63xx_uart.c
clps711x.c
cpm_uart.c
cpm_uart.h
digicolor-usart.c
dz.c
dz.h
earlycon-riscv-sbi.c
earlycon-semihost.c
earlycon.c
esp32_acm.c
esp32_uart.c
fsl_linflexuart.c
fsl_lpuart.c tty: serial: fsl_lpuart: Add missing wakeup event reporting 2025-10-22 12:04:51 +02:00
icom.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
imx.c tty: serial: imx: Add missing wakeup event reporting 2025-10-22 12:06:35 +02:00
imx_earlycon.c
ip22zilog.c tty: serial: ip22zilog: Use platform device for probing 2025-08-14 11:58:40 +02:00
ip22zilog.h
kgdboc.c drivers: serial: kgdboc: Drop checks for CON_ENABLED and CON_BOOT 2025-11-27 15:54:50 +01:00
lantiq.c serial: lantiq: Remove unnecessary print function dev_err() 2025-04-11 16:51:49 +02:00
liteuart.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
lpc32xx_hs.c
ma35d1_serial.c
max310x.c serial: max310x: improve interrupt handling 2025-09-12 16:10:16 +02:00
max3100.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mcf.c
men_z135_uart.c serial: men_z135_uart: drop unneeded MODULE_ALIAS 2026-01-16 14:25:04 +01:00
meson_uart.c
milbeaut_usio.c serial: Fix potential null-ptr-deref in mlb_usio_probe() 2025-04-11 16:53:34 +02:00
mpc52xx_uart.c
mps2-uart.c
msm_serial.c tty: remove redundant condition checks 2025-09-06 15:49:58 +02:00
mux.c serial: mux: Fix kernel doc for mux_poll() 2025-11-26 13:11:17 +01:00
mvebu-uart.c tty: serial: mvebu-uart: convert from round_rate() to determine_rate() 2025-08-14 11:59:04 +02:00
mxs-auart.c
omap-serial.c
owl-uart.c
pch_uart.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pic32_uart.c serial: pic32_uart: update include to use pic32.h from platform_data 2026-01-30 15:29:08 +01:00
pmac_zilog.c
pmac_zilog.h
pxa.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
qcom_geni_serial.c serial: qcom_geni: Fix BT failure regression on RB2 platform 2026-01-16 14:28:49 +01:00
rda-uart.c
rp2.c
rsci.c serial: rsci: Convert to FIELD_MODIFY() 2025-12-23 11:52:31 +01:00
rsci.h serial: sh-sci: Add support for RZ/G3E RSCI 2025-12-17 15:07:07 +01:00
sa1100.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
samsung_tty.c tty: serial: samsung: Declare earlycon for Exynos850 2025-11-26 13:11:55 +01:00
sb1250-duart.c
sc16is7xx.c serial: sc16is7xx: add comments for lock requirements 2025-10-28 15:25:41 +01:00
sc16is7xx.h serial: sc16is7xx: use KBUILD_MODNAME 2025-10-28 15:25:41 +01:00
sc16is7xx_i2c.c serial: sc16is7xx: use KBUILD_MODNAME 2025-10-28 15:25:41 +01:00
sc16is7xx_spi.c serial: sc16is7xx: use KBUILD_MODNAME 2025-10-28 15:25:41 +01:00
sccnxp.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
serial-tegra.c
serial_base.h
serial_base_bus.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
serial_core.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
serial_ctrl.c
serial_mctrl_gpio.c
serial_mctrl_gpio.h
serial_port.c
serial_txx9.c
sh-sci-common.h serial: sh-sci: Add finish_console_write() callback 2025-12-17 15:07:07 +01:00
sh-sci.c Merge 6.19-rc3 into tty-next 2025-12-29 09:31:39 +01:00
sifive.c Linux 6.15-rc4 2025-04-28 10:13:28 +02:00
sprd_serial.c serial: sprd: Return -EPROBE_DEFER when uart clock is not ready 2025-11-26 13:12:19 +01:00
st-asc.c
stm32-usart.c
stm32-usart.h
suncore.c
sunhv.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sunplus-uart.c
sunsab.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
sunsab.h
sunsu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sunzilog.c
sunzilog.h
tegra-tcu.c
tegra-utc.c serial: tegra-utc: Remove unneeded semicolon 2025-04-11 16:52:21 +02:00
timbuart.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
timbuart.h
uartlite.c tty: serial: uartlite: register uart driver in init 2025-04-11 16:52:06 +02:00
ucc_uart.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vt8500_serial.c
xilinx_uartps.c serial: xilinx_uartps: fix rs485 delay_rts_after_send 2025-12-23 11:55:16 +01:00
zs.c
zs.h