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

* Re: [PATCH blktests] blktests: use consistent helper returns
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2018-05-22  8:37 UTC (permalink / raw)
  To: Chaitanya Kulkarni; +Cc: linux-block, osandov

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N�rnberg
GF: Felix Imend�rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N�rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

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

* Re: [PATCH blktests] blktests: use consistent helper returns
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Omar Sandoval @ 2018-05-22 23:55 UTC (permalink / raw)
  To: Chaitanya Kulkarni; +Cc: linux-block

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.

^ permalink raw reply	[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