Re: [PATCH] coccinelle: Add devm_kmalloc_objs conversion script

From: Julia Lawall

Date: Wed Jun 24 2026 - 13:27:11 EST




On Wed, 24 Jun 2026, Joe Perches wrote:

> 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_KERNEL arg")
> >
> > Finds and converts sized devm_kmalloc-family of allocations into the typed
> > 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.

I was going to try it this evening. Are you concerned that it is too
much?

julia

>
> $ spatch -D patch --very-quiet --cocci-file ./scripts/coccinelle/api/devm_kmalloc_objs.cocci \
> --include-headers-for-types --all-includes --include-headers --keep-comments \
> -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include \
> -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi -I ./include/uapi \
> -I ./include/generated/uapi --include ./include/linux/compiler-version.h \
> --include ./include/linux/kconfig.h .
>