From: "Jérémy LEFAURE" <jeremy.lefaure@netatmo.com>
To: Julia Lawall <Julia.Lawall@inria.fr>,
Nicolas Palix <nicolas.palix@imag.fr>
Cc: "cocci@inria.fr" <cocci@inria.fr>,
Markus Elfring <Markus.Elfring@web.de>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>
Subject: [cocci] [PATCH v2] coccinelle: ifaddr: Find address test in more complex conditions
Date: Tue, 7 Jun 2022 09:15:37 +0000 [thread overview]
Message-ID: <AS8PR03MB760365A0DE3A8522136471BE93A59@AS8PR03MB7603.eurprd03.prod.outlook.com> (raw)
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@
--
2.25.1
next reply other threads:[~2022-06-07 9:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-07 9:15 Jérémy LEFAURE [this message]
2022-06-07 9:44 ` [cocci] [PATCH v2] coccinelle: ifaddr: Find address test in more complex conditions Julia Lawall
2022-06-07 18:33 ` Markus Elfring
2022-06-07 19:39 ` Julia Lawall
2022-06-08 12:04 ` Jérémy LEFAURE
2022-06-08 14:07 ` 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 16:20 ` Markus Elfring
2022-06-09 16:25 ` Julia Lawall
2022-06-09 17:34 ` Markus Elfring
2022-06-09 19:39 ` 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=AS8PR03MB760365A0DE3A8522136471BE93A59@AS8PR03MB7603.eurprd03.prod.outlook.com \
--to=jeremy.lefaure@netatmo.com \
--cc=Julia.Lawall@inria.fr \
--cc=Markus.Elfring@web.de \
--cc=cocci@inria.fr \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).