From 934adda1339707f4721af0a7a128e20737ed9986 Mon Sep 17 00:00:00 2001 From: Kent Gibson Date: Mon, 3 Jun 2024 19:56:26 +0800 Subject: [PATCH] tools: tests: check exit code directly Fix shellcheck SC2181[1] - check exit code directly. [1] https://www.shellcheck.net/wiki/SC2181 Signed-off-by: Kent Gibson Link: https://lore.kernel.org/r/20240603115628.102616-7-warthog618@gmail.com Signed-off-by: Bartosz Golaszewski --- tools/gpio-tools-test.bash | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/gpio-tools-test.bash b/tools/gpio-tools-test.bash index d9930f1..83b05ec 100755 --- a/tools/gpio-tools-test.bash +++ b/tools/gpio-tools-test.bash @@ -3069,8 +3069,7 @@ check_kernel() { check_prog() { local PROG=$1 - which "$PROG" > /dev/null - if [ "$?" -ne "0" ] + if ! which "$PROG" > /dev/null then die "$PROG not found - needed to run the tests" fi -- 2.30.2