tools: tests: fix unused variables
authorKent Gibson <warthog618@gmail.com>
Mon, 3 Jun 2024 11:56:23 +0000 (19:56 +0800)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 3 Jun 2024 12:02:35 +0000 (14:02 +0200)
Fix shellckeck SC2034[1] - foo appears unused.

Prefix intentionally unused variables with "_" and remove variables
not actually used.

[1] https://www.shellcheck.net/wiki/SC2034

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Link: https://lore.kernel.org/r/20240603115628.102616-4-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
tools/gpio-tools-test.bash

index 6bbb06cf2717866853bcc3274ffbe87077b12742..b06529626ae45733acdf42ba6630fcc1b1fa85b0 100755 (executable)
@@ -146,7 +146,7 @@ gpiosim_wait_value() {
        local CHIPNAME=${GPIOSIM_CHIP_NAME[$1]}
        local PORT=$GPIOSIM_SYSFS/$DEVNAME/$CHIPNAME/sim_gpio$OFFSET/value
 
-       for i in {1..30}; do
+       for _i in {1..30}; do
                [ "$(<$PORT)" = "$EXPECTED" ] && return
                sleep 0.01
        done
@@ -159,7 +159,6 @@ gpiosim_cleanup() {
                local NAME=${GPIOSIM_APP_NAME}-$$-$CHIP
 
                local DEVPATH=$GPIOSIM_CONFIGFS/$NAME
-               local BANKPATH=$DEVPATH/bank0
 
                echo 0 > $DEVPATH/live
                find "$DEVPATH" -type d -name hog -exec rmdir '{}' '+'
@@ -229,13 +228,13 @@ dut_readable() {
 }
 
 dut_flush() {
-       local JUNK
+       local _JUNK
        lines=()
        output=
        unset DUT_FIRST_CHAR
-       while read -t 0 -u ${COPROC[0]} JUNK
+       while read -t 0 -u "${COPROC[0]}" _JUNK
        do
-               read -t 0.1 -u ${COPROC[0]} JUNK || true
+               read -t 0.1 -u "${COPROC[0]}" _JUNK || true
        done
 }