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-sa1100/Kconfig | 92 ++ arch/arm/mach-sa1100/Makefile | 20 + arch/arm/mach-sa1100/assabet.c | 770 ++++++++++ arch/arm/mach-sa1100/clock.c | 145 ++ arch/arm/mach-sa1100/collie.c | 447 ++++++ arch/arm/mach-sa1100/generic.c | 470 +++++++ arch/arm/mach-sa1100/generic.h | 58 + arch/arm/mach-sa1100/h3600.c | 134 ++ arch/arm/mach-sa1100/h3xxx.c | 305 ++++ arch/arm/mach-sa1100/include/mach/SA-1100.h | 1798 ++++++++++++++++++++++++ arch/arm/mach-sa1100/include/mach/assabet.h | 99 ++ arch/arm/mach-sa1100/include/mach/bitfield.h | 113 ++ arch/arm/mach-sa1100/include/mach/collie.h | 94 ++ arch/arm/mach-sa1100/include/mach/generic.h | 1 + arch/arm/mach-sa1100/include/mach/h3xxx.h | 81 ++ arch/arm/mach-sa1100/include/mach/hardware.h | 56 + arch/arm/mach-sa1100/include/mach/irqs.h | 101 ++ arch/arm/mach-sa1100/include/mach/jornada720.h | 28 + arch/arm/mach-sa1100/include/mach/memory.h | 37 + arch/arm/mach-sa1100/include/mach/mtd-xip.h | 23 + arch/arm/mach-sa1100/include/mach/neponset.h | 31 + arch/arm/mach-sa1100/include/mach/reset.h | 18 + arch/arm/mach-sa1100/include/mach/uncompress.h | 52 + arch/arm/mach-sa1100/jornada720.c | 380 +++++ arch/arm/mach-sa1100/jornada720_ssp.c | 202 +++ arch/arm/mach-sa1100/neponset.c | 438 ++++++ arch/arm/mach-sa1100/pm.c | 128 ++ arch/arm/mach-sa1100/sleep.S | 143 ++ arch/arm/mach-sa1100/ssp.c | 240 ++++ 29 files changed, 6504 insertions(+) create mode 100644 arch/arm/mach-sa1100/Kconfig create mode 100644 arch/arm/mach-sa1100/Makefile create mode 100644 arch/arm/mach-sa1100/assabet.c create mode 100644 arch/arm/mach-sa1100/clock.c create mode 100644 arch/arm/mach-sa1100/collie.c create mode 100644 arch/arm/mach-sa1100/generic.c create mode 100644 arch/arm/mach-sa1100/generic.h create mode 100644 arch/arm/mach-sa1100/h3600.c create mode 100644 arch/arm/mach-sa1100/h3xxx.c create mode 100644 arch/arm/mach-sa1100/include/mach/SA-1100.h create mode 100644 arch/arm/mach-sa1100/include/mach/assabet.h create mode 100644 arch/arm/mach-sa1100/include/mach/bitfield.h create mode 100644 arch/arm/mach-sa1100/include/mach/collie.h create mode 100644 arch/arm/mach-sa1100/include/mach/generic.h create mode 100644 arch/arm/mach-sa1100/include/mach/h3xxx.h create mode 100644 arch/arm/mach-sa1100/include/mach/hardware.h create mode 100644 arch/arm/mach-sa1100/include/mach/irqs.h create mode 100644 arch/arm/mach-sa1100/include/mach/jornada720.h create mode 100644 arch/arm/mach-sa1100/include/mach/memory.h create mode 100644 arch/arm/mach-sa1100/include/mach/mtd-xip.h create mode 100644 arch/arm/mach-sa1100/include/mach/neponset.h create mode 100644 arch/arm/mach-sa1100/include/mach/reset.h create mode 100644 arch/arm/mach-sa1100/include/mach/uncompress.h create mode 100644 arch/arm/mach-sa1100/jornada720.c create mode 100644 arch/arm/mach-sa1100/jornada720_ssp.c create mode 100644 arch/arm/mach-sa1100/neponset.c create mode 100644 arch/arm/mach-sa1100/pm.c create mode 100644 arch/arm/mach-sa1100/sleep.S create mode 100644 arch/arm/mach-sa1100/ssp.c (limited to 'arch/arm/mach-sa1100') diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig new file mode 100644 index 000000000..d50721e39 --- /dev/null +++ b/arch/arm/mach-sa1100/Kconfig @@ -0,0 +1,92 @@ +# SPDX-License-Identifier: GPL-2.0-only +menuconfig ARCH_SA1100 + bool "SA11x0 Implementations (DEPRECATED)" + depends on ARCH_MULTI_V4 && !(ARCH_MULTI_V4T || ARCH_MULTI_V5) + depends on !(ARCH_MOXART || ARCH_GEMINI) + depends on ATAGS + depends on CPU_LITTLE_ENDIAN + depends on MMU + select ARCH_NO_SG_CHAIN + select ARCH_MTD_XIP + select CLKSRC_MMIO + select CLKSRC_PXA + select CPU_FREQ + select CPU_SA1100 + select GPIOLIB + select GPIOLIB_LEGACY + select IRQ_DOMAIN + select ISA + select NEED_MACH_MEMORY_H + help + Support for StrongARM 11x0 based boards. + + Support for these machines will go away in 2027, + unless there are any remaining users that speak up. + +if ARCH_SA1100 + +config SA1100_ASSABET + bool "Assabet" + select ARM_SA1110_CPUFREQ + select GPIO_REG + select LEDS_GPIO_REGISTER + select REGULATOR + select REGULATOR_FIXED_VOLTAGE + help + Say Y here if you are using the Intel(R) StrongARM(R) SA-1110 + Microprocessor Development Board (also known as the Assabet). + +config ASSABET_NEPONSET + bool "Include support for Neponset" + depends on SA1100_ASSABET + select SA1111 + help + Say Y here if you are using the Intel(R) StrongARM(R) SA-1110 + Microprocessor Development Board (Assabet) with the SA-1111 + Development Board (Nepon). + +config SA1100_COLLIE + bool "Sharp Zaurus SL5500" + # FIXME: select ARM_SA11x0_CPUFREQ + select SHARP_LOCOMO + select SHARP_PARAM + select SHARP_SCOOP + help + Say Y here to support the Sharp Zaurus SL5500 PDAs. + +config SA1100_H3600 + bool "Compaq iPAQ H3600/H3700" + select ARM_SA1110_CPUFREQ + select HTC_EGPIO + select MFD_IPAQ_MICRO + help + Say Y here if you intend to run this kernel on the Compaq iPAQ + H3600 and H3700 handheld computers. + +config SA1100_JORNADA720 + bool "HP Jornada 720" + # FIXME: select ARM_SA11x0_CPUFREQ + select SA1111 + help + Say Y here if you want to build a kernel for the HP Jornada 720 + handheld computer. See + + +config SA1100_JORNADA720_SSP + bool "HP Jornada 720 Extended SSP driver" + depends on SA1100_JORNADA720 + select SA1100_SSP + help + Say Y here if you have a HP Jornada 7xx handheld computer and you + want to access devices connected to the MCU. Those include the + keyboard, touchscreen, backlight and battery. This driver also activates + the generic SSP which it extends. + +config SA1100_SSP + tristate "Generic PIO SSP" + help + Say Y here to enable support for the generic PIO SSP driver. + This isn't for audio support, but for attached sensors and + other devices, eg for BadgePAD 4 sensor support. + +endif diff --git a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile new file mode 100644 index 000000000..b5816d675 --- /dev/null +++ b/arch/arm/mach-sa1100/Makefile @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for the linux kernel. +# + +# Common support +obj-y := clock.o generic.o #nmi-oopser.o + +# Specific board support +obj-$(CONFIG_SA1100_ASSABET) += assabet.o +obj-$(CONFIG_ASSABET_NEPONSET) += neponset.o +obj-$(CONFIG_SA1100_COLLIE) += collie.o +obj-$(CONFIG_SA1100_H3600) += h3600.o h3xxx.o +obj-$(CONFIG_SA1100_JORNADA720) += jornada720.o +obj-$(CONFIG_SA1100_JORNADA720_SSP) += jornada720_ssp.o + +# Miscellaneous functions +obj-$(CONFIG_PM) += pm.o sleep.o +obj-$(CONFIG_SA1100_SSP) += ssp.o + diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c new file mode 100644 index 000000000..b001f0b6a --- /dev/null +++ b/arch/arm/mach-sa1100/assabet.c @@ -0,0 +1,770 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * linux/arch/arm/mach-sa1100/assabet.c + * + * Author: Nicolas Pitre + * + * This file contains all Assabet-specific tweaks. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include