]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scripts: coccicheck: simplify debug file handling
authorBenjamin Philip <benjamin.philip495@gmail.com>
Tue, 6 Jan 2026 19:08:34 +0000 (00:38 +0530)
committerJulia Lawall <Julia.Lawall@inria.fr>
Sat, 21 Feb 2026 16:22:00 +0000 (17:22 +0100)
This commit separates handling unset files and pre-existing files. It
also eliminates a duplicated check for unset files in run_cmd_parmap().

Signed-off-by: Benjamin Philip <benjamin.philip495@gmail.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
scripts/coccicheck

index 89d591af5f3e7bf3302f92216c59a14c49332196..2efb74afef2b8e68db5bed2fc59037e27e9818f7 100755 (executable)
@@ -138,7 +138,7 @@ run_cmd_parmap() {
        if [ $VERBOSE -ne 0 ] ; then
                echo "Running ($NPROC in parallel): $@"
        fi
-       if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then
+       if [ "$DEBUG_FILE" != "/dev/null" ]; then
                 echo $@>>$DEBUG_FILE
                 $@ 2>>$DEBUG_FILE
         else
@@ -259,13 +259,13 @@ coccinelle () {
 
 }
 
-if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then
-       if [ -f $DEBUG_FILE ]; then
-               echo "Debug file $DEBUG_FILE exists, bailing"
-               exit
-       fi
-else
-       DEBUG_FILE="/dev/null"
+if [ "$DEBUG_FILE" = "" ]; then
+    DEBUG_FILE="/dev/null"
+fi
+
+if [ -f $DEBUG_FILE ]; then
+       echo "Debug file $DEBUG_FILE exists, bailing"
+       exit
 fi
 
 if [ "$COCCI" = "" ] ; then