diff mbox series

Fix SC2181 warning

Message ID 20250219040607.17125-1-ritvikfoss@gmail.com (mailing list archive)
State New
Headers show
Series Fix SC2181 warning | expand

Commit Message

ritvikfoss@gmail.com Feb. 19, 2025, 4:06 a.m. UTC
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 mbox series

Patch

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 "