From patchwork Tue Jun 19 20:23:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10475401 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8DB01601D7 for ; Tue, 19 Jun 2018 20:24:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C9D4286B2 for ; Tue, 19 Jun 2018 20:24:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71AD328BE8; Tue, 19 Jun 2018 20:24:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0ECD4286B2 for ; Tue, 19 Jun 2018 20:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755265AbeFSUYi (ORCPT ); Tue, 19 Jun 2018 16:24:38 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:47590 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967138AbeFSUX4 (ORCPT ); Tue, 19 Jun 2018 16:23:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1529439837; x=1560975837; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=JDurCfk58+SI8aYeouIUXUXY0WZVS07yMgn488JQuVM=; b=cuaT7x8ww/OTXuypjw2+k/2Drfe4tf2JBHjYl6JFn9LIFcKAw/WbPXWZ NhTAp9X59dk+rKIstJYWYofvwIzx5sD8CAyaPUbyicoZ+VMJpBEPvMbfA cFBo+gCZr8EW4hQoV+e6tXKDgyvl43wa/VGyctE0wtZ0lnzsBLLN/WDmF JwRkF25xrymaKbyMRX0HDQ5H6Dm9VmYronwH23/uZGjldlA+IG1y+5Lil RuQwFm5/CpwhgEo5uphpb25GuGvztITMeWT4n2FJx8K9xnStnbvNzULIN PyH0ZZACnR4NCNA8qPCmQZTWFWZMXF7mc2WpU2C/LE67A3iQ0fZMzKJwc g==; X-IronPort-AV: E=Sophos;i="5.51,244,1526313600"; d="scan'208";a="83215647" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 20 Jun 2018 04:23:57 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 19 Jun 2018 13:13:48 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip02.wdc.com with ESMTP; 19 Jun 2018 13:23:56 -0700 From: Bart Van Assche To: Omar Sandoval Cc: linux-block@vger.kernel.org, Bart Van Assche Subject: [PATCH 7/9] Avoid passing tests/block/002 arguments to _init_scsi_debug Date: Tue, 19 Jun 2018 13:23:51 -0700 Message-Id: <20180619202353.23631-8-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180619202353.23631-1-bart.vanassche@wdc.com> References: <20180619202353.23631-1-bart.vanassche@wdc.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Johannes Thumshirn --- 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