From patchwork Tue May 22 07:36:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 10417443 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 434EF600CC for ; Tue, 22 May 2018 07:36:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F4C7289AB for ; Tue, 22 May 2018 07:36:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2272B28B44; Tue, 22 May 2018 07:36:17 +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 855A3289AB for ; Tue, 22 May 2018 07:36:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751363AbeEVHgP (ORCPT ); Tue, 22 May 2018 03:36:15 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:37641 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751316AbeEVHgP (ORCPT ); Tue, 22 May 2018 03:36:15 -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=1526974576; x=1558510576; h=from:to:cc:subject:date:message-id; bh=zZGktbMhNmnZ6TONFYdZ2vIzQ9oRG437pEBBJ4HP+rk=; b=ezeNRb1jbY7e5K9REySbuib5ZV6vy4OrNbC0GMjxudFAFYEFEve19ENG Ta31RUst7GTBeO/nkI8JjeYl+aEGXG1gU+3V9e1GNA0AraP0dpPJXqv5T xgrQnmObZ87+/QQYEKgbuApDE5/DAbBNckg+o139UOWHSV4oFb6wNr5z2 diiPvJZwpTBGsZChqBhEFaS4J+75rg7X5WqtGUcD+rnEFJPyyUKFcAlxJ La2ShmJDyEhTJcjKjIkD8pL4GOBfTEYgFN4syYxFr59vbqqTNkoHySeeJ r7//v6HxlFxVtJNtokfpBUePriof89Sjkiv+gvzoUkkuvlJAbXtrkrk8R Q==; X-IronPort-AV: E=Sophos;i="5.49,429,1520870400"; d="scan'208";a="80268300" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 22 May 2018 15:36:16 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 22 May 2018 00:26:40 -0700 Received: from qemu.hgst.com ([10.202.65.140]) by uls-op-cesaip01.wdc.com with ESMTP; 22 May 2018 00:36:15 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: osandov@osandov.com, Chaitanya Kulkarni Subject: [PATCH blktests] blktests: use consistent helper returns Date: Tue, 22 May 2018 03:36:11 -0400 Message-Id: <20180522073611.4022-1-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.9.5 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 is a cleanup patch which uses consistent return values for helper functions. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn --- common/rc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/common/rc b/common/rc index e59ae0b..936b21d 100644 --- a/common/rc +++ b/common/rc @@ -51,10 +51,9 @@ _have_root() { _have_module() { if modprobe -n -q "$1"; then return 0 - else - SKIP_REASON="$1 module is not available" - return 1 fi + SKIP_REASON="$1 module is not available" + return 1 } _have_module_param() { @@ -62,15 +61,15 @@ _have_module_param() { SKIP_REASON="$1 module does not have parameter $2" return 1 fi + return 0 } _have_program() { if command -v "$1" >/dev/null 2>&1; then return 0 - else - SKIP_REASON="$1 is not available" - return 1 fi + SKIP_REASON="$1 is not available" + return 1 } _have_src_program() {