[blktests] blktests: use consistent helper returns
diff mbox

Message ID 20180522073611.4022-1-chaitanya.kulkarni@wdc.com
State New
Headers show

Commit Message

Chaitanya Kulkarni May 22, 2018, 7:36 a.m. UTC
This is a cleanup patch which uses consistent return values
for helper functions.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 common/rc | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Johannes Thumshirn May 22, 2018, 8:37 a.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Omar Sandoval May 22, 2018, 11:55 p.m. UTC | #2
On Tue, May 22, 2018 at 03:36:11AM -0400, Chaitanya Kulkarni wrote:
> This is a cleanup patch which uses consistent return values
> for helper functions.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

Thanks, applied.

Patch
diff mbox

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() {