All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] coccinelle: ifaddr: Find address test in more complex conditions
@ 2022-06-07  9:15 ` Jérémy LEFAURE
  0 siblings, 0 replies; 24+ messages in thread
From: Jérémy LEFAURE @ 2022-06-07  9:15 UTC (permalink / raw)
  To: Julia Lawall, Nicolas Palix; +Cc: cocci, Markus Elfring, kernel-janitors

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

^ permalink raw reply related	[flat|nested] 24+ messages in thread
* [cocci] [PATCH] coccinelle: ifaddr: Find address test in more complex conditions
@ 2022-05-30 15:40 Jérémy LEFAURE
  2022-06-04 14:02 ` Markus Elfring
  0 siblings, 1 reply; 24+ messages in thread
From: Jérémy LEFAURE @ 2022-05-30 15:40 UTC (permalink / raw)
  To: Julia Lawall, Nicolas Palix; +Cc: cocci

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>
---
 scripts/coccinelle/misc/ifaddr.cocci | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/coccinelle/misc/ifaddr.cocci b/scripts/coccinelle/misc/ifaddr.cocci
index fc92e8fcbfcb..387af44a1256 100644
--- a/scripts/coccinelle/misc/ifaddr.cocci
+++ b/scripts/coccinelle/misc/ifaddr.cocci
@@ -18,8 +18,16 @@ statement S1,S2;
 position p;
 @@
 
+(
 *if@p (&x)
  S1 else S2
+|
+*if@p (&x || ...)
+ S1 else S2
+|
+*if@p (&x && ...)
+ S1 else S2
+)
 
 @script:python depends on org@
 p << r.p;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2022-06-09 20:44 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
  -- strict thread matches above, loose matches on Subject: below --
2022-05-30 15:40 [cocci] [PATCH] " Jérémy LEFAURE
2022-06-04 14:02 ` Markus Elfring
2022-06-04 14:11   ` Julia Lawall
2022-06-04 14:32     ` [cocci] " Markus Elfring
2022-06-04 14:50       ` Julia Lawall

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.