Re: [cocci] [PATCH] coccinelle: Add devm_kmalloc_objs conversion script

Joe Perches <[email protected]> Wed, 24 Jun 2026 10:02:40 -0700
Newsgroups fr.inria.cocci,dev.linux.lists.driver-core,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Mon, 2026-06-15 at 19:10 -0700, Joe Perches wrote:
> Like commit bdc5071d7f7b ("coccinelle: Add kmalloc_objs conversion script=
")
> with commit 1c7bbaeed110 ("coccinelle: kmalloc_obj: Remove default GFP_KE=
RNEL arg")
>=20
> Finds and converts sized devm_kmalloc-family of allocations into the type=
d
> devm_kmalloc_obj-family of allocations.

Its been a bit.
Any comments or negatives about using or running this script?

This script would change more than 8000 instances in more than
5000 files in Linus' current master.

$ spatch -D patch --very-quiet --cocci-file ./scripts/coccinelle/api/devm_k=
malloc_objs.cocci \
    --include-headers-for-types --all-includes --include-headers --keep-com=
ments \
    -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include \
    -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi -I ./in=
clude/uapi \
    -I ./include/generated/uapi --include ./include/linux/compiler-version.=
h \
    --include ./include/linux/kconfig.h .