From 3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Wed, 2 Sep 2026 15:31:14 -0700 Subject: treewide: refresh kmalloc_obj() conversions This is another run of the Coccinelle script for converting kmalloc() family of allocations to kmalloc_obj() via the existing rules in scripts/coccinelle/api/kmalloc_objs.cocci This catches both the set of kmalloc() uses added since the first kmalloc_obj() conversions in v7.0 and adds a large group missed in the first pass due to Coccinelle not interacting well with the cleanup.h scoped_...() family of macros[1]. I worked around this with spatch's "--macro-file" argument to a file with all the scoped_...() macros mapped to Coccinelle's YACFE_ITERATOR[2] as that was the closest viable control flow indicator I could find. Build tested allmodconfig on x86, arm64, arm, loongarch, mips, powerpc, riscv, and s390 with no new warnings. Link: https://lore.kernel.org/lkml/202609021314.8A9C0B8@keescook/ [1] Link: https://github.com/coccinelle/coccinelle/blob/master/standard.h [2] Signed-off-by: Kees Cook --- arch/arm/mach-footbridge/Kconfig | 57 ++ arch/arm/mach-footbridge/Makefile | 18 + arch/arm/mach-footbridge/common.c | 280 ++++++++ arch/arm/mach-footbridge/common.h | 15 + arch/arm/mach-footbridge/dc21285-timer.c | 136 ++++ arch/arm/mach-footbridge/dc21285.c | 360 ++++++++++ arch/arm/mach-footbridge/dma-isa.c | 230 ++++++ arch/arm/mach-footbridge/ebsa285-pci.c | 48 ++ arch/arm/mach-footbridge/ebsa285.c | 124 ++++ arch/arm/mach-footbridge/include/mach/hardware.h | 90 +++ arch/arm/mach-footbridge/include/mach/irqs.h | 97 +++ arch/arm/mach-footbridge/include/mach/isa-dma.h | 18 + arch/arm/mach-footbridge/include/mach/memory.h | 26 + arch/arm/mach-footbridge/include/mach/uncompress.h | 34 + arch/arm/mach-footbridge/isa-irq.c | 177 +++++ arch/arm/mach-footbridge/isa-rtc.c | 57 ++ arch/arm/mach-footbridge/isa-timer.c | 36 + arch/arm/mach-footbridge/isa.c | 94 +++ arch/arm/mach-footbridge/netwinder-hw.c | 772 +++++++++++++++++++++ arch/arm/mach-footbridge/netwinder-pci.c | 62 ++ 20 files changed, 2731 insertions(+) create mode 100644 arch/arm/mach-footbridge/Kconfig create mode 100644 arch/arm/mach-footbridge/Makefile create mode 100644 arch/arm/mach-footbridge/common.c create mode 100644 arch/arm/mach-footbridge/common.h create mode 100644 arch/arm/mach-footbridge/dc21285-timer.c create mode 100644 arch/arm/mach-footbridge/dc21285.c create mode 100644 arch/arm/mach-footbridge/dma-isa.c create mode 100644 arch/arm/mach-footbridge/ebsa285-pci.c create mode 100644 arch/arm/mach-footbridge/ebsa285.c create mode 100644 arch/arm/mach-footbridge/include/mach/hardware.h create mode 100644 arch/arm/mach-footbridge/include/mach/irqs.h create mode 100644 arch/arm/mach-footbridge/include/mach/isa-dma.h create mode 100644 arch/arm/mach-footbridge/include/mach/memory.h create mode 100644 arch/arm/mach-footbridge/include/mach/uncompress.h create mode 100644 arch/arm/mach-footbridge/isa-irq.c create mode 100644 arch/arm/mach-footbridge/isa-rtc.c create mode 100644 arch/arm/mach-footbridge/isa-timer.c create mode 100644 arch/arm/mach-footbridge/isa.c create mode 100644 arch/arm/mach-footbridge/netwinder-hw.c create mode 100644 arch/arm/mach-footbridge/netwinder-pci.c (limited to 'arch/arm/mach-footbridge') diff --git a/arch/arm/mach-footbridge/Kconfig b/arch/arm/mach-footbridge/Kconfig new file mode 100644 index 000000000..96a74d447 --- /dev/null +++ b/arch/arm/mach-footbridge/Kconfig @@ -0,0 +1,57 @@ +# SPDX-License-Identifier: GPL-2.0-only +menuconfig ARCH_FOOTBRIDGE + bool "FootBridge Implementations (DEPRECATED)" + depends on ARCH_MULTI_V4 && !(ARCH_MULTI_V4T || ARCH_MULTI_V5) + depends on !(ARCH_MOXART || ARCH_GEMINI || ARCH_SA1100) + depends on ATAGS + depends on CPU_LITTLE_ENDIAN + depends on MMU + select ARCH_NO_SG_CHAIN + select CPU_SA110 + select FOOTBRIDGE + select NEED_MACH_MEMORY_H + help + Support for systems based on the DC21285 companion chip + ("FootBridge"), used in the EBSA285 and the Rebel NetWinder. + + Support for these machines will go away in 2027, + unless there are any remaining users that speak up. + +if ARCH_FOOTBRIDGE + +config ARCH_EBSA285_HOST + bool "EBSA285 (host mode)" + select ARCH_EBSA285 + select ISA + select ARCH_MAY_HAVE_PC_FDC + select FORCE_PCI + help + Say Y here if you intend to run this kernel on the EBSA285 card + in host ("central function") mode. + + Saying N will reduce the size of the Footbridge kernel. + +config ARCH_NETWINDER + bool "NetWinder" + select CLKEVT_I8253 + select CLKSRC_I8253 + select ISA + select FORCE_PCI + help + Say Y here if you intend to run this kernel on the Rebel.COM + NetWinder. Information about this machine can be found at: + + + + Saying N will reduce the size of the Footbridge kernel. + +# Footbridge support +config FOOTBRIDGE + def_bool y + select ARCH_MIGHT_HAVE_PC_SERIO + select ISA_DMA_API + +config ARCH_EBSA285 + bool + +endif diff --git a/arch/arm/mach-footbridge/Makefile b/arch/arm/mach-footbridge/Makefile new file mode 100644 index 000000000..1553cc01b --- /dev/null +++ b/arch/arm/mach-footbridge/Makefile @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for the linux kernel. +# + +# Object file lists. + +obj-y := common.o isa-irq.o isa.o isa-rtc.o dma-isa.o + +pci-y += dc21285.o +pci-$(CONFIG_ARCH_EBSA285) += ebsa285-pci.o +pci-$(CONFIG_ARCH_NETWINDER) += netwinder-pci.o + +obj-$(CONFIG_ARCH_EBSA285) += ebsa285.o dc21285-timer.o +obj-$(CONFIG_ARCH_NETWINDER) += netwinder-hw.o isa-timer.o + +obj-$(CONFIG_PCI) +=$(pci-y) + diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c new file mode 100644 index 000000000..85c598708 --- /dev/null +++ b/arch/arm/mach-footbridge/common.c @@ -0,0 +1,280 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * linux/arch/arm/mach-footbridge/common.c + * + * Copyright (C) 1998-2000 Russell King, Dave Gilbert. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include