diff mbox

bcache: fix wrong return value in bch_debug_init()

Message ID 1514201980-30595-1-git-send-email-tang.junhui@zte.com.cn (mailing list archive)
State New, archived
Headers show

Commit Message

tang.junhui@zte.com.cn Dec. 25, 2017, 11:39 a.m. UTC
From: Tang Junhui <tang.junhui@zte.com.cn>

in bch_debug_init(), ret is always 0, and the return value is useless,
change it to return 0 if be success after calling debugfs_create_dir(),
else return a non-zero value.

Signed-off-by: Tang Junhui <tang.junhui@zte.com.cn>
---
 drivers/md/bcache/debug.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Michael Lyle Dec. 27, 2017, 10:22 p.m. UTC | #1
On 12/25/2017 03:39 AM, tang.junhui@zte.com.cn wrote:
> From: Tang Junhui <tang.junhui@zte.com.cn>
> 
> in bch_debug_init(), ret is always 0, and the return value is useless,
> change it to return 0 if be success after calling debugfs_create_dir(),
> else return a non-zero value.
> 
> Signed-off-by: Tang Junhui <tang.junhui@zte.com.cn>

LGTM, applied to my staging branch.  (Still line ending issues but
easily fixed with checkpatch.pl --fix)

Thanks,

Mike
diff mbox

Patch

diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
index c7a02c4..2bb0b28
--- a/drivers/md/bcache/debug.c
+++ b/drivers/md/bcache/debug.c
@@ -251,8 +251,7 @@  void bch_debug_exit(void)
 
 int __init bch_debug_init(struct kobject *kobj)
 {
-	int ret = 0;
-
 	debug = debugfs_create_dir("bcache", NULL);
-	return ret;
+
+	return IS_ERR_OR_NULL(debug);
 }