mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Joel Granados <j.granados@samsung.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>, Kees Cook <kees@kernel.org>,
	 Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] sysctl: treewide: constify the ctl_table argument of proc_handlers
Date: Wed, 24 Jul 2024 11:32:26 +0200	[thread overview]
Message-ID: <84dc8f21-78d2-4ea2-ad79-3f85b610c0a7@t-8ch.de> (raw)
In-Reply-To: <20240724091817.eohhckduvtjscibg@joelS2.panther.com>

On 2024-07-24 11:18:17+0000, Joel Granados wrote:
> On Wed, Jul 24, 2024 at 10:56:10AM +0200, Thomas Weißschuh wrote:
> > On 2024-07-24 10:41:24+0000, Joel Granados wrote:
> ...
> > > > > to be in master before we send the PR to Linus. Will check these three
> > > > > dependencies on Wednesday next week and send your V2 [3] if I see that
> > > > > it applies cleanly.
> > > > 
> > > > All dependency PRs (sysctl, net, mm) are now merged.
> > > > My compilation tests all succeed now.
> > > 
> > > How did you apply the coccinelle script? I ask because if I do this:
> > > ```
> > >  make coccicheck MODE=patch SPFLAGS="--in-place --include-headers" COCCI=SCRIPT
> > > ```
> > > 
> > > I have to add "virtual patch" to the first line of the script you had
> > > sent. So it would look like this:
> > > ```
> > > virtual patch
> > > 
> > > @@
> > > identifier func, ctl, write, buffer, lenp, ppos;
> > > @@
> > > 
> > > int func(
> > > - struct ctl_table *ctl,
> > > + const struct ctl_table *ctl,
> > >   int write, void *buffer, size_t *lenp, loff_t *ppos)
> > > { ... }
> > > ```
> > 
> > Yes, IIRC I got told during one review to drop it.
> > But for me it is also necessary.
> I also remember a comment from the XFS part of the patches where you
> changed the formatting on some functions. What did you do to address
> this? Did you change them manually? Or do you have a script?

Yes, the style fixes were done manually.

> > Thinking back, there were other "virtual" lines, too.
> > Maybe those were to ones that needed to be removed, but
> > "virtual patch" should stay.

> Understood.
> 
> > 
> > > Additionally, this cocci script is not changing the header files. Even
> > > if I pass --include-headers. Did you change those by hand?
> > 
> > Yes, I changed these manually, originally.
> > 
> > To do it through the script, you need a second subpatch:
> > 
> > ```
> > @@
> > identifier func, ctl, write, buffer, lenp, ppos;
> > @@
> > 
> > int func(
> > - struct ctl_table *ctl,
> > + const struct ctl_table *ctl,
> >   int write, void *buffer, size_t *lenp, loff_t *ppos);
> > ```
> Yes. But you are still missing one more subpatch to catch the function
> declarations in header files that don't name the arguments; like the
> ones in include/linux/mm.h. This is what I used for those:
> ```
> @r3@
> identifier func;
> @@
> 
> int func(
> - struct ctl_table *,
> + const struct ctl_table *,
>   int , void *, size_t *, loff_t *);
> ```
> 
> > 
> > (It doesn't find anything else, though)
> Maybe you are missing running it with --include-headers?

There seems to be a slight misunderstanding.
I meant that it does not find anything *new* on top of the existing
patch, not that it can fully recreate the patch.

(I used --include-headers, undid one header hunk from the patch and
validated that the hunk gets recreated)

> This is the full cocci script that I have:
> ```
> virtual patch
> 
> @r1@
> identifier func, ctl, write, buffer, lenp, ppos;
> @@
> 
> int func(
> - struct ctl_table *ctl,
> + const struct ctl_table *ctl,
>   int write, void *buffer, size_t *lenp, loff_t *ppos);
> 
> @r2@
> identifier func, ctl, write, buffer, lenp, ppos;
> @@
> 
> int func(
> - struct ctl_table *ctl,
> + const struct ctl_table *ctl,
>   int write, void *buffer, size_t *lenp, loff_t *ppos)
> { ... }
> 
> @r3@
> identifier func;
> @@
> 
> int func(
> - struct ctl_table *,
> + const struct ctl_table *,
>   int , void *, size_t *, loff_t *);
> ```

LGTM, thanks.

  reply	other threads:[~2024-07-24  9:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240619100941eucas1p25d522dca3b74c899434b97b0c0dc78a0@eucas1p2.samsung.com>
2024-06-19 10:09 ` Thomas Weißschuh
2024-06-19 20:51   ` Kees Cook
2024-07-24 21:05     ` Joel Granados
2024-07-24 21:29       ` Kees Cook
2024-06-20  8:22   ` Joel Granados
2024-06-20 10:34   ` Joel Granados
2024-06-20 14:34     ` Thomas Weißschuh
2024-06-20 23:45   ` Luis Chamberlain
2024-07-15 20:23   ` Joel Granados
2024-07-15 20:58     ` Thomas Weißschuh
2024-07-16 15:27       ` Joel Granados
2024-07-17 15:26         ` Thomas Weißschuh
2024-07-17 19:57           ` Joel Granados
2024-07-22  7:41             ` Thomas Weißschuh
2024-07-23  8:33               ` Joel Granados
2024-07-24  8:41               ` Joel Granados
2024-07-24  8:56                 ` Thomas Weißschuh
2024-07-24  9:18                   ` Joel Granados
2024-07-24  9:32                     ` Thomas Weißschuh [this message]
2024-07-24 18:20                       ` Joel Granados
2024-07-24 18:43                         ` Thomas Weißschuh

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=84dc8f21-78d2-4ea2-ad79-3f85b610c0a7@t-8ch.de \
    --to=linux@weissschuh.net \
    --cc=akpm@linux-foundation.org \
    --cc=j.granados@samsung.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    /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®