[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-7e9798871a9186cb831cf693d7ff58085384ccbd@git.kernel.org>
Date: Tue, 11 Dec 2018 07:23:14 -0800
From: tip-bot for Bart Van Assche <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: tglx@...utronix.de, johannes@...solutions.net, longman@...hat.com,
sasha.levin@...cle.com, peterz@...radead.org,
torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org,
mingo@...nel.org, hpa@...or.com, bvanassche@....org
Subject: [tip:locking/core] tools/lib/lockdep/tests: Fix shellcheck warnings
Commit-ID: 7e9798871a9186cb831cf693d7ff58085384ccbd
Gitweb: https://git.kernel.org/tip/7e9798871a9186cb831cf693d7ff58085384ccbd
Author: Bart Van Assche <bvanassche@....org>
AuthorDate: Thu, 6 Dec 2018 17:11:26 -0800
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 11 Dec 2018 14:54:48 +0100
tools/lib/lockdep/tests: Fix shellcheck warnings
Use find instead of ls to avoid splitting filenames that contain spaces.
Use rm -f instead of if ... then rm ...; fi. This patch addresses all
shellcheck complaints about the run_tests.sh shell script.
Signed-off-by: Bart Van Assche <bvanassche@....org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Johannes Berg <johannes@...solutions.net>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Sasha Levin <sasha.levin@...cle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Waiman Long <longman@...hat.com>
Cc: johannes.berg@...el.com
Cc: tj@...nel.org
Link: https://lkml.kernel.org/r/20181207011148.251812-3-bvanassche@acm.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
tools/lib/lockdep/run_tests.sh | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/tools/lib/lockdep/run_tests.sh b/tools/lib/lockdep/run_tests.sh
index 9f31f84e7fac..253719ee6377 100755
--- a/tools/lib/lockdep/run_tests.sh
+++ b/tools/lib/lockdep/run_tests.sh
@@ -7,7 +7,7 @@ if ! make >/dev/null; then
exit 1
fi
-for i in `ls tests/*.c`; do
+find tests -name '*.c' | sort | while read -r i; do
testname=$(basename "$i" .c)
echo -ne "$testname... "
if gcc -o "tests/$testname" -pthread "$i" liblockdep.a -Iinclude -D__USE_LIBLOCKDEP &&
@@ -16,12 +16,10 @@ for i in `ls tests/*.c`; do
else
echo "FAILED!"
fi
- if [ -f "tests/$testname" ]; then
- rm tests/$testname
- fi
+ rm -f "tests/$testname"
done
-for i in `ls tests/*.c`; do
+find tests -name '*.c' | sort | while read -r i; do
testname=$(basename "$i" .c)
echo -ne "(PRELOAD) $testname... "
if gcc -o "tests/$testname" -pthread -Iinclude "$i" &&
@@ -30,7 +28,5 @@ for i in `ls tests/*.c`; do
else
echo "FAILED!"
fi
- if [ -f "tests/$testname" ]; then
- rm tests/$testname
- fi
+ rm -f "tests/$testname"
done
Powered by blists - more mailing lists