All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: "Jérémy Lefaure" <jeremy.lefaure@netatmo.com>,
	cocci@inria.fr, kernel-janitors@vger.kernel.org
Cc: Julia Lawall <Julia.Lawall@inria.fr>,
	Nicolas Palix <nicolas.palix@imag.fr>
Subject: Re: [cocci] [PATCH v2] coccinelle: ifaddr: Find address test in more complex conditions
Date: Tue, 7 Jun 2022 20:33:21 +0200	[thread overview]
Message-ID: <415ca02b-9618-b447-6471-6bcd0e2215e8@web.de> (raw)
In-Reply-To: <AS8PR03MB760365A0DE3A8522136471BE93A59@AS8PR03MB7603.eurprd03.prod.outlook.com>


> The test of an expression's address does not necessarily represent the
> whole condition, it may only be a part of it.
> This change aims at detecting an address test in more complex conditions.
>
> Signed-off-by: Jérémy Lefaure <jeremy.lefaure@netatmo.com>
> ---
> v1 -> v2: Moved disjunction on the condition itself instead of being on the if statements
>
>  scripts/coccinelle/misc/ifaddr.cocci | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/coccinelle/misc/ifaddr.cocci b/scripts/coccinelle/misc/ifaddr.cocci
> index fc92e8fcbfcb..14dbf3131a3f 100644
> --- a/scripts/coccinelle/misc/ifaddr.cocci
> +++ b/scripts/coccinelle/misc/ifaddr.cocci
> @@ -18,7 +18,7 @@ statement S1,S2;
>  position p;
>  @@
>
> -*if@p (&x)
> +*if@p ( \(&x || ... \| &x && ... \) )
>   S1 else S2
>
>  @script:python depends on org@


Would you ever dare to adjust the specification another bit for such
a source code search approach according to the difference in the selection
of the operators “||” (disjunction) and “&&” (conjunction)?

Regards,
Markus


  parent reply	other threads:[~2022-06-07 18:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07  9:15 [PATCH v2] coccinelle: ifaddr: Find address test in more complex conditions Jérémy LEFAURE
2022-06-07  9:15 ` [cocci] " Jérémy LEFAURE
2022-06-07  9:44 ` Julia Lawall
2022-06-07  9:44   ` [cocci] " Julia Lawall
2022-06-07 18:33 ` Markus Elfring [this message]
2022-06-07 19:39   ` Julia Lawall
2022-06-07 19:39     ` Julia Lawall
2022-06-08 12:04     ` Jérémy LEFAURE
2022-06-08 12:04       ` [cocci] " Jérémy LEFAURE
2022-06-08 14:07       ` Julia Lawall
2022-06-08 14:07         ` [cocci] " Julia Lawall
2022-06-08 17:44     ` [cocci] " Markus Elfring
2022-06-09 15:07     ` Markus Elfring
2022-06-09 15:41       ` Julia Lawall
2022-06-09 15:41         ` [cocci] " Julia Lawall
2022-06-09 16:20         ` Markus Elfring
2022-06-09 16:25           ` Julia Lawall
2022-06-09 16:25             ` [cocci] " Julia Lawall
2022-06-09 17:34             ` Markus Elfring
2022-06-09 19:39               ` Julia Lawall
2022-06-09 19:39                 ` [cocci] " Julia Lawall
2022-06-09 20:44                 ` 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=415ca02b-9618-b447-6471-6bcd0e2215e8@web.de \
    --to=markus.elfring@web.de \
    --cc=Julia.Lawall@inria.fr \
    --cc=cocci@inria.fr \
    --cc=jeremy.lefaure@netatmo.com \
    --cc=kernel-janitors@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 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.