* [PATCH] Fix SC2181 warning
@ 2025-02-19 4:06 ritvikfoss
0 siblings, 0 replies; only message in thread
From: ritvikfoss @ 2025-02-19 4:06 UTC (permalink / raw)
To: shuah; +Cc: linux-kselftest, skhan, linux-kernel-mentees
From: Ritvik Gupta <ritvikfoss@gmail.com>
Check exit-code directly with '!' instead of '$?'
to improve readability and fix SC2181 warning,
reported by shellcheck.
Signed-off-by: Ritvik Gupta <ritvikfoss@gmail.com>
---
tools/testing/selftests/kselftest_deps.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/kselftest_deps.sh b/tools/testing/selftests/kselftest_deps.sh
index 487e49fdf2a6..2a4720723ebf 100755
--- a/tools/testing/selftests/kselftest_deps.sh
+++ b/tools/testing/selftests/kselftest_deps.sh
@@ -262,8 +262,8 @@ then
for lib in $test_libs; do
let total_cnt+=1
- $CC -o $tmp_file.bin $lib $tmp_file > /dev/null 2>&1
- if [ $? -ne 0 ]; then
+ if ! $CC -o $tmp_file.bin $lib $tmp_file > /dev/null 2>&1
+ then
echo "FAIL: $test dependency check: $lib" >> $fail
let fail_cnt+=1
fail_libs+="$lib "
--
2.48.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-02-19 4:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-19 4:06 [PATCH] Fix SC2181 warning ritvikfoss
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.