Skip to contentSkip to conversation

Fix SC2181 warning

PATCH New [email protected] 1 participant 1 message Feb 19, 2025 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix SC2181 warning

From: Ritvik Gupta <[email protected]>

Check exit-code directly with '!' instead of '$?'
to improve readability and fix SC2181 warning,
reported by shellcheck.

---
 tools/testing/selftests/kselftest_deps.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/kselftest_deps.sh +2 -2
index 487e49fdf2a6..2a4720723ebf 100755
@@ -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 "
Signature · 1 line
2.48.1