All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Kees Cook <kees@kernel.org>,
	driver-core@lists.linux.dev,
	Nicolas Palix <nicolas.palix@imag.fr>,
	cocci@inria.fr
Subject: Re: [resend PATCH] coccinelle: Add devm_kmalloc_objs conversion script
Date: Sun, 01 Nov 2026 17:05:58 -0800	[thread overview]
Message-ID: <2556411d9bf65125cf5c1dfa37eb4454@perches.com> (raw)
In-Reply-To: <1a6026c4-3e19-a1a9-e637-f1842172482b@inria.fr>

On 2026-11-01 15:51, Julia Lawall wrote:
> On Sun, 1 Nov 2026, 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.
> 
> Applied
> 
>> 
>> Signed-off-by: Joe Perches <joe@perches.com>
>> ---
>> 
>> Maybe this might be useful to run and apply just prior to some -rc1
>> 
>> 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_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 .
> 
> I'm not sure that --include-headers-for-types is useful.  That is 
> useful
> when there is an expression metavariable that is required to have a
> particular type.  I don't see that here.  I also got around 5000 
> changes
> in Linus's current master without using that argument.  I didn't try 
> it,
> but I think --no-includes would thus be fine.  --include-headers will 
> get
> the changes in the header files.
> 
> If the --keep comments argument is useful, it could be added to the
> semantic patch, by putting #spatch --keep-comments at the top of the 
> file.

Ok. Whatever is appropriate.

I just copied the command line from the one that applied the commits 
above.

  reply	other threads:[~2026-11-02  1:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-01 10:35 [resend PATCH] coccinelle: Add devm_kmalloc_objs conversion script Joe Perches
2026-11-01 23:51 ` Julia Lawall
2026-11-01 23:51   ` [cocci] " Julia Lawall
2026-11-02  1:05   ` Joe Perches [this message]
2026-11-02  8:52   ` Kees Cook
2026-11-02  9:09     ` Julia Lawall
2026-11-02  9:09       ` [cocci] " Julia Lawall
2026-11-03  1:47       ` Kees Cook
2026-11-03 10:40         ` [cocci] " Julia Lawall
2026-11-03 10:40           ` Julia Lawall
2026-11-02 13:24     ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2556411d9bf65125cf5c1dfa37eb4454@perches.com \
    --to=joe@perches.com \
    --cc=cocci@inria.fr \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=julia.lawall@inria.fr \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.palix@imag.fr \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.