All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Markus Elfring <Markus.Elfring@web.de>,
	 Luis Chamberlain <mcgrof@kernel.org>,
	cocci@inria.fr
Subject: Re: [cocci] mm/slab: prepare for struct page conversion by spatch
Date: Sun, 7 Nov 2021 19:09:59 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2111071908410.2988@hadrien> (raw)
In-Reply-To: <89bb8f39-4527-a1b4-dab9-82929773e9d9@suse.cz>



On Sun, 7 Nov 2021, Vlastimil Babka wrote:

> On 11/7/21 13:50, Markus Elfring wrote:
> >>> * Will any guidance help to find nicer solutions?
> >>
> >> Luis already proposed a perfectly reasonable solution.
> >
> > His proposal can look a bit too terse (for affected implementation details),
> > can't it?
> > https://sympa.inria.fr/sympa/arc/cocci/2021-11/msg00017.html
> > https://lore.kernel.org/cocci/YYVZva1hfwanXdyB@bombadil.infradead.org/
>
> I don't mind terse, I wasn't asking for complete fixup of my patches,
> but for hints, and I got plenty from all of you, thanks! Will try to
> apply everything tomorrow.
>
> > @@
> > @@
> > -struct page
> > +struct slab
>
> The above is itself incomplete to go from "struct page *page" to "struct
> slab *slab", but will results in "struct slab *page".
>
> So my attempts included:
> - struct page *page
> + struct slab *slab
>
> But that for some reason resulted in spatch reporting (IIRC) syntax

A variable declaration needs a semicolon.

> errors, so I had to change it to this:
>
> - struct page *page;
> + struct slab *slab;

If you first rename struct page as strict slab and then do

struct slab *
- page
+ slab
 ;

it might work even for the multiple declaration case.

julia

> And that worked in most cases, but didn't handle the multiple variables
> being declared nor declaration+assignment.
>
> But I assume Luis' suggestion is supposed to work together with the rule
> that does simply -page +slab. I'll see how it works out, and also
> Julia's suggestion "just have one rule to change all occurences of page
> to slab, and then have individual rules to change eg page_address(slab)
> to slab_address(slab)."
>
> Thanks,
> Vlastimil
>

  reply	other threads:[~2021-11-07 18:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05 16:12 [cocci] Need some help with spatch Vlastimil Babka
2021-11-05 16:20 ` Luis Chamberlain
2021-11-06  6:44   ` Julia Lawall
2021-11-07 23:08   ` Vlastimil Babka
2021-11-08 14:35     ` Vlastimil Babka
2021-11-08 14:45       ` Julia Lawall
2021-11-08 16:53         ` Vlastimil Babka
2021-11-08 17:01           ` Julia Lawall
2021-11-05 20:56 ` Julia Lawall
2021-11-05 21:13 ` Julia Lawall
2021-11-05 21:24   ` Vlastimil Babka
2021-11-05 21:27     ` Julia Lawall
2021-11-05 21:31 ` Julia Lawall
2021-11-05 21:32   ` Vlastimil Babka
2021-11-05 21:43 ` Julia Lawall
2021-11-05 21:59 ` Julia Lawall
2021-11-06 15:36 ` [cocci] mm/slab: mass conversion of struct page to struct slab by spatch Markus Elfring
2021-11-07 12:10 ` [cocci] mm/slab: prepare for struct patch conversion " Markus Elfring
2021-11-07 12:22   ` Julia Lawall
2021-11-07 12:50     ` [cocci] mm/slab: prepare for struct page " Markus Elfring
2021-11-07 13:18       ` Julia Lawall
2021-11-07 13:40         ` Markus Elfring
2021-11-07 17:50       ` Vlastimil Babka
2021-11-07 18:09         ` Julia Lawall [this message]
2021-11-08 17:35           ` Markus Elfring
2021-11-08 17:40             ` Julia Lawall
2021-11-08 23:35             ` Vlastimil Babka

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=alpine.DEB.2.22.394.2111071908410.2988@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=Markus.Elfring@web.de \
    --cc=cocci@inria.fr \
    --cc=mcgrof@kernel.org \
    --cc=vbabka@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.