Messages in this thread Patch in this message |  | | Date | Mon, 9 Mar 2026 15:32:20 +0100 | | From | Alejandro Colomar <> | | Subject | Re: [PATCH v2] scripts/coccinelle: Add script for using ARRAY_END() |
| |
Hi Markus,
On 2026-03-09T15:05:08+0100, Markus Elfring wrote: > … > > --- > > scripts/coccinelle/misc/array_end.cocci | 74 +++++++++++++++++++++++++ > … > > Some contributors would appreciate patch version descriptions. > https://lore.kernel.org/all/?q=%22This+looks+like+a+new+version+of+a+previously+submitted+patch%22 > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.0-rc3#n310
I replied to all of your comments, and said how I would address them, in reply to v1. This v2 is in-reply-to v1, so that that sub-thread is easy to find. And at the bottom is a range-diff where you can find all the exact changes from v1 to v2.
I could have noted in plain English the changes from v1 to v2, but I thought it might be a bit redundant.
> May a subdirectory name be omitted from the subject prefix? > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/scripts/coccinelle/
Yeah, we could do that. Here's what I checked for writing the subject prefix:
$ git log --oneline --author Lawall torvalds/master scripts/coccinelle/misc/ f01701ce update Coccinelle URL 92b2dada scripts/coccinelle: drop bugon.cocci c3003315 scripts: coccinelle: boolinit: drop warnings on named constants 518d8a56 scripts: coccinelle: Correct warning message b825b432 scripts: coccinelle: only suggest true/false in files that already use> 937c812d coccinelle: orplus: reorganize to improve performance 69c4907b Coccinelle: use false positive annotation f75621c6 coccinelle: bugon: reduce rule applicability c7eaa887 Coccinelle: array_size: reduce rule applicability 8f551bef Coccinelle: reduce rule applicability 74a8478f coccinelle: misc: move constants to the right 932058a5 coccinelle: misc: semantic patch to delete overly complex return code > 24f0c2d6 scripts/coccinelle: find constant additions that could be bit ors ad99ac2f scripts/coccinelle/misc/warn.cocci: use WARN 2cbd0825 scripts/coccinelle: sizeof of pointer 4619c2b8 scripts/coccinelle: address test is always true 89910581 coccinelle: semantic patch for bool issues 4a05f067 coccinelle: semantic patch to check for PTR_ERR after reassignment 29a36d4d scripts/coccinelle: improve the coverage of some semantic patches a1087ef6 scripts/coccinelle: update for compatability with Coccinelle 0.2.4
Since the latest line and a decent amount of lines have "scripts/coccinelle", I picked that. I don't have a preference, so please let me know what's the preferred one. I tend to prefer more explicit ones, even if slightly longer, but I'll take whatever the maintainers' preference is.
The only one I didn't really like was the 'scripts: coccinelle:' one. Paths are more readable if we're going to include all the subdirectories. But this is just my opinion.
> … > > +// Comments: No known false positives, but has a few false negatives > > Would such information motivate for any further software refinements?
Yes, if anyone here knows how to handle the false negatives and wants to work with me on improving those, I'm very interested.
Here's one case which isn't caught, for example (which I expect will be difficult to handle, if not impossible):
@@ -2876,7 +2876,7 @@ static struct dentry *proc_##LSM##_attr_dir_lookup(struct inode *dir, \ { \ return proc_pident_lookup(dir, dentry, \ LSM##_attr_dir_stuff, \ - LSM##_attr_dir_stuff + ARRAY_SIZE(LSM##_attr_dir_stuff)); \ + ARRAY_END(LSM##_attr_dir_stuff)); \ } \ \ static const struct inode_operations proc_##LSM##_attr_dir_inode_ops = { \
I could research and find other false negatives.
Cheers, Alex
-- <https://www.alejandro-colomar.es> [unhandled content-type:application/pgp-signature] |  |