diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2020-10-04 11:44:48 +0200 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2020-10-04 12:32:21 +0200 |
commit | 1813613fedaf65d54bae8048cf9f922ec643fbd7 (patch) | |
tree | 082398f219eaca88deda523e70bad625676bf6e6 /coccinelle | |
parent | coccinelle: skip the xsprintf transformation on man pages (diff) | |
download | systemd-1813613fedaf65d54bae8048cf9f922ec643fbd7.tar.xz systemd-1813613fedaf65d54bae8048cf9f922ec643fbd7.zip |
coccinelle: limit the # of expressions in in_set/not_in_set
transformations. Otherwise the time and resources to generate all
possible permutations is simply unreasonable for running on local
machines.
Diffstat (limited to 'coccinelle')
-rw-r--r-- | coccinelle/in_set.cocci | 16 | ||||
-rw-r--r-- | coccinelle/not_in_set.cocci | 15 |
2 files changed, 4 insertions, 27 deletions
diff --git a/coccinelle/in_set.cocci b/coccinelle/in_set.cocci index 2c9b94ceb6..1c17c7df1f 100644 --- a/coccinelle/in_set.cocci +++ b/coccinelle/in_set.cocci @@ -1,25 +1,13 @@ +/* Limit the number of expressions to 6 for performance reasons */ @@ expression e; /* Exclude JsonVariant * from the transformation, as it can't work with the * current version of the IN_SET macro */ typedef JsonVariant; type T != JsonVariant*; -constant T n0, n1, n2, n3, n4, n5, n6, n7, n8, n9; +constant T n0, n1, n2, n3, n4, n5; @@ - ( -- 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) -| -- 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) -| -- 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) -| -- e == n0 || e == n1 || e == n2 || e == n3 || e == n4 || e == n5 || e == n6 -+ IN_SET(e, n0, n1, n2, n3, n4, n5, n6) -| - e == n0 || e == n1 || e == n2 || e == n3 || e == n4 || e == n5 + IN_SET(e, n0, n1, n2, n3, n4, n5) | diff --git a/coccinelle/not_in_set.cocci b/coccinelle/not_in_set.cocci index aed2c3490c..3486cff5df 100644 --- a/coccinelle/not_in_set.cocci +++ b/coccinelle/not_in_set.cocci @@ -1,22 +1,11 @@ +/* Limit the number of expressions to 6 for performance reasons */ @@ expression e; typedef JsonVariant; type T != JsonVariant*; -constant T n0, n1, n2, n3, n4, n5, n6, n7, n8, n9; +constant T n0, n1, n2, n3, n4, n5; @@ ( -- 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) -| -- 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) -| -- 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) -| -- e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 && e != n6 -+ !IN_SET(e, n0, n1, n2, n3, n4, n5, n6) -| - e != n0 && e != n1 && e != n2 && e != n3 && e != n4 && e != n5 + !IN_SET(e, n0, n1, n2, n3, n4, n5) | |