Re: [cocci] [PATCH 1/3] coccinelle: mini_lock: improve performance when searching loops

Julia Lawall <[email protected]> Sun, 26 Jul 2026 16:14:07 +0200 (CEST)
Newsgroups fr.inria.cocci,org.kernel.vger.kernel-janitors,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323329-1864106738-1785075247=:181691
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT



On Sun, 26 Jul 2026, Markus Elfring wrote:

> …
> > +++ b/scripts/coccinelle/locks/mini_lock.cocci
> > @@ -53,11 +53,31 @@ spin_lock_irq@p1
> >  spin_lock_irqsave@p1
> >  ) (E1@p,...);
> >
> > -@looped@
> > +@err_candidate exists@
> > +expression E1;
> > +position prelocked.p;
> > +position up != prelocked.p1;
> > +position rc;
> …
>
> Can it help a bit to avoid the repetition of the type
> for a few metavariables?
>
> +position prelocked.p, up != prelocked.p1, rc;

It's fine as is.

julia
--8323329-1864106738-1785075247=:181691--