All of lore.kernel.org
 help / color / mirror / Atom feed
* [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; 6+ 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] 6+ messages in thread

end of thread, other threads:[~2022-06-07  8:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-30 15:40 [cocci] [PATCH] coccinelle: ifaddr: Find address test in more complex conditions 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
2022-06-07  8:18   ` [cocci] [PATCH] " Jérémy LEFAURE

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.