public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH blktests] blktests: use consistent helper returns
@ 2018-05-22  7:36 Chaitanya Kulkarni
  2018-05-22  8:37 ` Johannes Thumshirn
  2018-05-22 23:55 ` Omar Sandoval
  0 siblings, 2 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2018-05-22  7:36 UTC (permalink / raw)
  To: linux-block; +Cc: osandov, Chaitanya Kulkarni

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

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-22 23:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-22  7:36 [PATCH blktests] blktests: use consistent helper returns Chaitanya Kulkarni
2018-05-22  8:37 ` Johannes Thumshirn
2018-05-22 23:55 ` Omar Sandoval

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox