From: Alejandro Colomar <alx@kernel.org>
To: Julia Lawall <Julia.Lawall@inria.fr>,
Nicolas Palix <nicolas.palix@imag.fr>,
cocci@inria.fr
Cc: Alejandro Colomar <alx@kernel.org>, Kees Cook <kees@kernel.org>
Subject: [cocci] [PATCH v1 0/1] scripts/coccinelle: Add script for using ARRAY_END()
Date: Fri, 6 Mar 2026 00:20:12 +0100 [thread overview]
Message-ID: <cover.1772752564.git.alx@kernel.org> (raw)
Hi!
This is a script to help find and replace uses of ARRAY_SIZE() to find
the end of an array (a pointer one past the last element). We already
replaced some uses a few months ago, fixing some bugs while doing that,
and now I've written a coccinelle patch to do it elsewhere.
This is the first time I write a script under scripts/coccinelle/, so
take it with a grain of salt. I've tested it, and I see no false
positives. However, I've found several false negatives (for example,
in macros, or where the argument is a struct member).
Have a lovely night!
Alex
Alejandro Colomar (1):
scripts/coccinelle: Add script for using ARRAY_END()
scripts/coccinelle/misc/array_end.cocci | 93 +++++++++++++++++++++++++
1 file changed, 93 insertions(+)
create mode 100644 scripts/coccinelle/misc/array_end.cocci
Range-diff against v0:
-: -------- > 1: f1c9dff5 scripts/coccinelle: Add script for using ARRAY_END()
--
2.53.0
next reply other threads:[~2026-03-09 9:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 23:20 Alejandro Colomar [this message]
2026-03-05 23:20 ` [cocci] [PATCH v1 1/1] scripts/coccinelle: Add script for using ARRAY_END() Alejandro Colomar
2026-03-09 11:17 ` [cocci] [PATCH] " Markus Elfring
2026-03-09 11:59 ` Julia Lawall
2026-03-09 12:16 ` Alejandro Colomar
2026-03-09 12:10 ` Alejandro Colomar
2026-03-09 12:21 ` Julia Lawall
2026-03-09 12:27 ` Alejandro Colomar
2026-03-09 12:13 ` [cocci] [PATCH v2] " Alejandro Colomar
2026-03-09 14:05 ` Markus Elfring
2026-03-09 14:32 ` Alejandro Colomar
2026-03-15 17:17 ` Alejandro Colomar
2026-03-15 17:54 ` Julia Lawall
2026-03-15 22:05 ` Alejandro Colomar
2026-03-16 7:18 ` [cocci] [v2] " Markus Elfring
2026-03-16 10:39 ` Alejandro Colomar
2026-03-16 10:46 ` Markus Elfring
2026-03-15 22:11 ` [cocci] [PATCH v3] " Alejandro Colomar
2026-03-15 22:12 ` Alejandro Colomar
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=cover.1772752564.git.alx@kernel.org \
--to=alx@kernel.org \
--cc=Julia.Lawall@inria.fr \
--cc=cocci@inria.fr \
--cc=kees@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