]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests/tc-testing: Fix warning and style check on tdc.sh
authorChia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
Tue, 22 Jul 2025 09:59:13 +0000 (11:59 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 24 Jul 2025 00:52:08 +0000 (17:52 -0700)
Replace exit code check with '! cmd' and add both quote and $(...)
around 'nproc' to prevent warning and issue reported by shellcheck.

Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
Link: https://patch.msgid.link/20250722095915.24485-5-chia-yu.chang@nokia-bell-labs.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/tc-testing/tdc.sh

index 589b18ed758a6cca50ef62d58a5f596e4e293cbc..7a81088802d1a8fb53fbd08c0b48f6349a18d18d 100755 (executable)
@@ -4,8 +4,7 @@
 # If a module is required and was not compiled
 # the test that requires it will fail anyways
 try_modprobe() {
-   modprobe -q -R "$1"
-   if [ $? -ne 0 ]; then
+   if ! modprobe -q -R "$1"; then
       echo "Module $1 not found... skipping."
    else
       modprobe "$1"
@@ -67,4 +66,4 @@ try_modprobe sch_hfsc
 try_modprobe sch_hhf
 try_modprobe sch_htb
 try_modprobe sch_teql
-./tdc.py -J`nproc`
+./tdc.py -J"$(nproc)"