]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coccinelle: drop the custom isomorphisms
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 1 Oct 2020 14:11:43 +0000 (16:11 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Sun, 4 Oct 2020 10:32:21 +0000 (12:32 +0200)
My former dumb me didn't read the documentation properly, so with the
introduction of custom isomorphisms I caused two issues:

1) Masked all standard isomorphisms defined by Coccinelle
2) Replace the original issue with a completely new one

coccinelle/run-coccinelle.sh
coccinelle/systemd-definitions.iso [deleted file]

index be80a76a5f3b50cb0c60dd96e8d5bd3176541d4c..1fdef5f63ef6cc96a89a94f0251ead03dd2d42ac 100755 (executable)
@@ -10,7 +10,6 @@ EXCLUDED_PATHS=(
 )
 
 top="$(git rev-parse --show-toplevel)"
-iso_defs="$top/coccinelle/systemd-definitions.iso"
 args=
 
 # Create an array from files tracked by git...
@@ -37,7 +36,7 @@ for SCRIPT in ${@-$top/coccinelle/*.cocci} ; do
     TMPFILE=`mktemp`
     echo "+ spatch --sp-file $SCRIPT $args ..."
     parallel --halt now,fail=1 --keep-order --noswap --max-args=20 \
-             spatch --iso-file $iso_defs --sp-file $SCRIPT $args ::: "${files[@]}" \
+             spatch --sp-file $SCRIPT $args ::: "${files[@]}" \
              2>"$TMPFILE" || cat "$TMPFILE"
     echo -e "--x-- Processed $SCRIPT --x--\n"
 done
diff --git a/coccinelle/systemd-definitions.iso b/coccinelle/systemd-definitions.iso
deleted file mode 100644 (file)
index 92db763..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Statement isomorphisms - replace explicit checks against NULL with a
- * shorter variant, which relies on C's downgrade-to-bool feature.
- * The expression metavariables should be declared as pointers, however,
- * that doesn't work well with complex expressions like:
- * if (UNIT(p)->default_dependencies != NULL)
- */
-
-Statement
-@@
-expression X;
-statement S;
-@@
-if (X == NULL) S => if (!X) S
-
-Statement
-@@
-expression X;
-statement S;
-@@
-if (X != NULL) S => if (X) S