From: ritvikfoss@gmail.com
To: shuah@kernel.org
Cc: linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org,
linux-kernel-mentees@lists.linuxfoundation.org
Subject: [PATCH] Fix SC2181 warning
Date: Wed, 19 Feb 2025 09:36:07 +0530 [thread overview]
Message-ID: <20250219040607.17125-1-ritvikfoss@gmail.com> (raw)
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
reply other threads:[~2025-02-19 4:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250219040607.17125-1-ritvikfoss@gmail.com \
--to=ritvikfoss@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox