mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Alejandro Colomar <alx@kernel.org>,
	cocci@inria.fr, Julia Lawall <Julia.Lawall@inria.fr>,
	Nicolas Palix <nicolas.palix@imag.fr>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org, Kees Cook <kees@kernel.org>
Subject: Re: [cocci] [PATCH] scripts/coccinelle: Add script for using ARRAY_END()
Date: Mon, 9 Mar 2026 12:17:00 +0100	[thread overview]
Message-ID: <cab3d2a8-4c3f-45e6-9e7f-8bdca48a6209@web.de> (raw)
In-Reply-To: <f1c9dff525752dc5a839760269a1c96d6e0870b4.1772752564.git.alx@kernel.org>

…
> This script makes it easy to find more places where that macro should be
> used.

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.0-rc3#n94> +++ b/scripts/coccinelle/misc/array_end.cocci
> @@ -0,0 +1,93 @@
> +// Confidence: ???

I hope that a more reasonable value can be determined for this information.


…
> +// Comments:

Please omit such an empty field.


…
> +@i@
> +@@
> +
> +#include <linux/kernel.h>

I doubt that such an SmPL rule would be required.


> +
> +//----------------------------------------------------------
> +//  For context mode
> +//----------------------------------------------------------
> +

Please omit such extra comment lines.


> +@depends on i&&context@
> +type T;
> +T[] a;
> +expression b;
> +@@
> +(
> +* (a + ARRAY_SIZE(a))
> +|
> +* (&a[0] + ARRAY_SIZE(a))
> +|
> +* (&a[ARRAY_SIZE(a)])
> +|
> +* (&a[ARRAY_SIZE(a) - b])
> +)

Extra space characters may be omitted directly after SmPL asterisks.


…
> +@r depends on (org || report)@

You may omit parentheses here.


…
> +@script:python depends on report@
> +p << r.p;
> +@@
> +
> +msg="WARNING: Use ARRAY_END"
> +coccilib.report.print_report(p[0], msg)

Would the following command variant be a bit nicer?

coccilib.report.print_report(p[0], "WARNING: opportunity for ARRAY_END()")



By the way:
How do you think about to omit a cover letter for a single patch?

Regards,
Markus

       reply	other threads:[~2026-03-09 11:17 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   ` Markus Elfring [this message]
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
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=cab3d2a8-4c3f-45e6-9e7f-8bdca48a6209@web.de \
    --to=markus.elfring@web.de \
    --cc=Julia.Lawall@inria.fr \
    --cc=alx@kernel.org \
    --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

all inboxes | Powered by JetHome®