[PATCH blktests 07/15] Avoid passing tests/block/002 arguments to _init_scsi_debug

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

 



This patch avoids that shellcheck reports the following:

tests/block/002:34:7: note: Use _init_scsi_debug "$@" if function's $1 should mean script's $1. [SC2119]

Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxx>
---
 common/scsi_debug | 3 +++
 tests/block/002   | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/scsi_debug b/common/scsi_debug
index e26e85637369..d8e6b71899a3 100644
--- a/common/scsi_debug
+++ b/common/scsi_debug
@@ -21,7 +21,10 @@ _have_scsi_debug() {
 	_have_module scsi_debug
 }
 
+# The _init_scsi_debug() argument list is passed to modprobe scsi_debug. "--"
+# is filtered out from the start of the argument list.
 _init_scsi_debug() {
+	[ "$1" = "--" ] && shift
 	if ! modprobe -r scsi_debug || ! modprobe scsi_debug "$@"; then
 		return 1
 	fi
diff --git a/tests/block/002 b/tests/block/002
index 32a0f818b95b..10e3f157c018 100755
--- a/tests/block/002
+++ b/tests/block/002
@@ -31,7 +31,7 @@ requires() {
 test() {
 	echo "Running ${TEST_NAME}"
 
-	if ! _init_scsi_debug; then
+	if ! _init_scsi_debug --; then
 		return 1
 	fi
 
-- 
2.17.1




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux