diff options
author | Andreas Rammhold <andreas@rammhold.de> | 2017-09-29 09:58:22 +0200 |
---|---|---|
committer | Andreas Rammhold <andreas@rammhold.de> | 2017-10-02 13:09:56 +0200 |
commit | ec2ce0c5d7623c83dabf50c98253f5b0c0fb1359 (patch) | |
tree | 2be64c5b07a1c2cde8c2244a78b5e4c5e125e4b9 /coccinelle | |
parent | tree-wide: use IN_SET where possible (diff) | |
download | systemd-ec2ce0c5d7623c83dabf50c98253f5b0c0fb1359.tar.xz systemd-ec2ce0c5d7623c83dabf50c98253f5b0c0fb1359.zip |
tree-wide: use `!IN_SET(..)` for `a != b && a != c && …`
The included cocci was used to generate the changes.
Thanks to @flo-wer for pointing this case out.
Diffstat (limited to 'coccinelle')
-rw-r--r-- | coccinelle/not_in_set.cocci | 147 |
1 files changed, 147 insertions, 0 deletions
diff --git a/coccinelle/not_in_set.cocci b/coccinelle/not_in_set.cocci new file mode 100644 index 0000000000..e6bcf47893 --- /dev/null +++ b/coccinelle/not_in_set.cocci @@ -0,0 +1,147 @@ +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17, n18, n19, n20; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 && e != n7 && e != n8 && e != n9 && e != n10 && e != n11 && e != n12 && e != n13 && e != n14 && e != n15 && e != n16 && e != n17 && e != n18 && e != n19 && e != n20 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17, n18, n19, n20) +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17, n18, n19; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 && e != n7 && e != n8 && e != n9 && e != n10 && e != n11 && e != n12 && e != n13 && e != n14 && e != n15 && e != n16 && e != n17 && e != n18 && e != n19 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17, n18, n19) +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17, n18; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 && e != n7 && e != n8 && e != n9 && e != n10 && e != n11 && e != n12 && e != n13 && e != n14 && e != n15 && e != n16 && e != n17 && e != n18 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17, n18) +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 && e != n7 && e != n8 && e != n9 && e != n10 && e != n11 && e != n12 && e != n13 && e != n14 && e != n15 && e != n16 && e != n17 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17) +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 && e != n7 && e != n8 && e != n9 && e != n10 && e != n11 && e != n12 && e != n13 && e != n14 && e != n15 && e != n16 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16) +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 && e != n7 && e != n8 && e != n9 && e != n10 && e != n11 && e != n12 && e != n13 && e != n14 && e != n15 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15) +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 && e != n7 && e != n8 && e != n9 && e != n10 && e != n11 && e != n12 && e != n13 && e != n14 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14) +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 && e != n7 && e != n8 && e != n9 && e != n10 && e != n11 && e != n12 && e != n13 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13) +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 && e != n7 && e != n8 && e != n9 && e != n10 && e != n11 && e != n12 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12) +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 && e != n7 && e != n8 && e != n9 && e != n10 && e != n11 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11) +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 && e != n7 && e != n8 && e != n9 && e != n10 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10) +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5, n6, n7, n8, n9; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 && e != n7 && e != n8 && e != n9 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6, n7, n8, n9) +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5, n6, n7, n8; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 && e != n7 && e != n8 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6, n7, n8) +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5, n6, n7; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 && e != n7 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6, n7) +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5, n6; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6) +@@ +expression e; +identifier n0, n1, n2, n3, n4, n5; +statement s; +@@ +- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 ++ !IN_SET(e, n0, n1, n2, n3, n4, n5) +@@ +expression e; +identifier n1, n2, n3, n4, n5; +statement s; +@@ +- e != n1 && e != n2 && e != n3 && e != n4 && e != n5 ++ !IN_SET(e, n1, n2, n3, n4, n5) +@@ +expression e; +identifier n1, n2, n3, n4; +statement s; +@@ +- e != n1 && e != n2 && e != n3 && e != n4 ++ !IN_SET(e, n1, n2, n3, n4) +@@ +expression e; +identifier n1, n2, n3, n4; +statement s; +@@ +- e != n1 && e != n2 && e != n3 && e != n4 ++ !IN_SET(e, n1, n2, n3, n4) +@@ +expression e; +identifier n1, n2, n3; +statement s; +@@ +- e != n1 && e != n2 && e != n3 ++ !IN_SET(e, n1, n2, n3) +@@ +expression e; +identifier n, p; +statement s; +@@ +- e != n && e != p ++ !IN_SET(e, n, p) |