From: Markus Elfring <Markus.Elfring@web.de>
To: Joe Perches <joe@perches.com>,
cocci@inria.fr, driver-core@lists.linux.dev,
Julia Lawall <julia.lawall@inria.fr>,
Nicolas Palix <nicolas.palix@imag.fr>
Cc: LKML <linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kees Cook <kees@kernel.org>
Subject: Re: [cocci] [PATCH] coccinelle: Add devm_kmalloc_objs conversion script
Date: Thu, 25 Jun 2026 07:45:33 +0200 [thread overview]
Message-ID: <ee9dda04-d4fb-4bb6-9c3a-d4c04a2b6170@web.de> (raw)
In-Reply-To: <eed0c57a2c897e34d411229c3de41c5402791894.1781575297.git.joe@perches.com>
> +virtual patch
Will additional operation modes become relevant after clarification of implementation details?
…
> +def alloc_array(name):
> + func = "FAILED_RENAME"
> + if name == "devm_kmalloc_array":
> + func = "devm_kmalloc_objs"
…
* I suggest to avoid duplicate variable assignments.
* How do you think about to collaborate with the Python data structure “dictionary”?
…
> +expression VAR;
> +expression GFP;
> +expression COUNT;
…
Such repetition of SmPL key words can eventually be also avoided.
…
> +|
> + BYTES_PTRS = ALLOC(DEV,(sizeof(E)), GFP)
> +|
> + BYTES_PTRS = ALLOC(DEV,(sizeof(TYPE)), GFP)
> +|
…
I see possibilities to refine such an SmPL disjunction.
…
> +@drop_gfp_kernel depends on patch && !(file in "tools") && !(file in "samples")@
> +identifier ALLOC = {devm_kmalloc_obj,devm_kmalloc_objs,devm_kmalloc_flex,
> + devm_kzalloc_obj,devm_kzalloc_objs,devm_kzalloc_flex,
> + devm_kvmalloc_obj,devm_kvmalloc_objs,devm_kvmalloc_flex,
> + devm_kvzalloc_obj,devm_kvzalloc_objs,devm_kvzalloc_flex};
> +@@
…
Can development interests grow for more advanced management of such function names?
Regards,
Markus
prev parent reply other threads:[~2026-06-25 5:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 2:10 Joe Perches
2026-06-24 17:02 ` Joe Perches
2026-06-24 17:25 ` Julia Lawall
2026-06-24 17:52 ` Joe Perches
2026-06-25 5:45 ` Markus Elfring [this message]
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=ee9dda04-d4fb-4bb6-9c3a-d4c04a2b6170@web.de \
--to=markus.elfring@web.de \
--cc=cocci@inria.fr \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=julia.lawall@inria.fr \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.palix@imag.fr \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®