[libgpiod][PATCH 3/8] tools: tests: fix unused variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix shellckeck SC2034[1] - foo appears unused.

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

Signed-off-by: Kent Gibson <warthog618@xxxxxxxxx>

[1] https://www.shellcheck.net/wiki/SC2034
---
 tools/gpio-tools-test.bash | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/tools/gpio-tools-test.bash b/tools/gpio-tools-test.bash
index 6bbb06c..b065296 100755
--- a/tools/gpio-tools-test.bash
+++ b/tools/gpio-tools-test.bash
@@ -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
 }
 
-- 
2.39.2





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux