diff options
author | Jérémy LEFAURE <jeremy.lefaure@netatmo.com> | 2022-07-01 18:01:36 +0200 |
---|---|---|
committer | Julia Lawall <Julia.Lawall@inria.fr> | 2022-07-03 23:45:05 +0200 |
commit | 38857318692acd02353b47129bb06326528a47c0 (patch) | |
tree | 824a9115c86877ffd2c180002e0f8d19931fd9e3 /scripts | |
parent | Merge tag 'xfs-5.19-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux (diff) | |
download | linux-38857318692acd02353b47129bb06326528a47c0.tar.xz linux-38857318692acd02353b47129bb06326528a47c0.zip |
coccinelle: Extend address test from ifaddr semantic patch to test expressions
The test of an expression's address does not necessarily represent the
whole condition, it may only be a part of it. Also, an expression's
address is likely to be non-zero in every test expression, not only in
if statements.
This change aims at detecting an address test in more complex conditions
and not only in if statements.
Signed-off-by: Jérémy Lefaure <jeremy.lefaure@netatmo.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/coccinelle/misc/test_addr.cocci (renamed from scripts/coccinelle/misc/ifaddr.cocci) | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/scripts/coccinelle/misc/ifaddr.cocci b/scripts/coccinelle/misc/test_addr.cocci index fc92e8fcbfcb..029db9069c44 100644 --- a/scripts/coccinelle/misc/ifaddr.cocci +++ b/scripts/coccinelle/misc/test_addr.cocci @@ -14,12 +14,10 @@ virtual context @r@ expression x; -statement S1,S2; position p; @@ -*if@p (&x) - S1 else S2 +*\(&x@p == NULL \| &x@p != NULL\) @script:python depends on org@ p << r.p; |