From: Alejandro Colomar <alx@kernel.org>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Julia Lawall <Julia.Lawall@inria.fr>,
cocci@inria.fr, Nicolas Palix <nicolas.palix@imag.fr>,
Kees Cook <kees@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [v2] scripts/coccinelle: Add script for using ARRAY_END()
Date: Mon, 16 Mar 2026 11:39:33 +0100 [thread overview]
Message-ID: <abfdDqYbRWZ6UNjB@devuan> (raw)
In-Reply-To: <0c5eded9-f56a-434c-a04f-b229945ae4c5@web.de>
[-- Attachment #1: Type: text/plain, Size: 1784 bytes --]
Hi Markus,
On 2026-03-16T08:18:17+0100, Markus Elfring wrote:
[...]
> …
> > +++ b/arch/powerpc/kernel/rtas.c
> > @@ -555,10 +555,8 @@ static struct rtas_function rtas_function_table[] __ro_after_init = {
> > },
> > };
> >
> > -#define for_each_rtas_function(funcp) \
> > - for (funcp = &rtas_function_table[0]; \
> > - funcp < &rtas_function_table[ARRAY_SIZE(rtas_function_table)]; \
> > - ++funcp)
> > +#define for_each_rtas_function(f) \
> > + for (f = rtas_function_table; f < ARRAY_END(rtas_function_table); ++f)
>
> Are there development challenges to reconsider for macro definitions?
I've seen cases within macros that were correctly reported, so it's not
an issue with macros.
> …
> > +++ b/drivers/net/wireless/intel/iwlwifi/mei/net.c
> > @@ -43,7 +43,7 @@ static bool iwl_mei_rx_filter_eth(const struct ethhdr *ethhdr,
> > return false;
> >
> > for (filt = &filters->eth_filters[0];
> > - filt < &filters->eth_filters[0] + ARRAY_SIZE(filters->eth_filters);
> > + filt < ARRAY_END(filters->eth_filters);
> > filt++) {
> > /* Assume there are no enabled filter after a disabled one */
> > if (!(filt->flags & SAP_ETH_FILTER_ENABLED))
>
> Will any loops become better supported?
I've seen cases within loops that worked correctly, so it's not an issue
with loops.
After debugging like Julia suggested, it was indeed what Julia guessed:
some files can't be parsed correctly, at places unrelated to this.
There's nothing we can do to improve the patch.
Have a lovely day!
Alex
--
<https://www.alejandro-colomar.es>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2026-03-16 10:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1772752564.git.alx@kernel.org>
[not found] ` <f1c9dff525752dc5a839760269a1c96d6e0870b4.1772752564.git.alx@kernel.org>
2026-03-09 11:17 ` [cocci] [PATCH] scripts/coccinelle: Add script for using ARRAY_END() 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
[not found] ` <9fd8d3d1e7ef3efb6e6dae0972dd515ff02e42bd.1773058287.git.alx@kernel.org>
2026-03-09 14:05 ` [PATCH v2] " 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 ` [v2] " Markus Elfring
2026-03-16 10:39 ` Alejandro Colomar [this message]
2026-03-16 10:46 ` Markus Elfring
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=abfdDqYbRWZ6UNjB@devuan \
--to=alx@kernel.org \
--cc=Julia.Lawall@inria.fr \
--cc=Markus.Elfring@web.de \
--cc=cocci@inria.fr \
--cc=kees@kernel.org \
--cc=kernel-janitors@vger.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