bcache: do not check if debug dentry is ERR or NULL explicitly on remove
authorShenghui Wang <shhuiw@foxmail.com>
Thu, 13 Dec 2018 14:53:47 +0000 (22:53 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 13 Dec 2018 15:15:54 +0000 (08:15 -0700)
debugfs_remove and debugfs_remove_recursive will check if the dentry
pointer is NULL or ERR, and will do nothing in that case.

Remove the check in cache_set_free and bch_debug_init.

Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/debug.c
drivers/md/bcache/super.c

index 8f448b9..8b123be 100644 (file)
@@ -249,8 +249,7 @@ void bch_debug_init_cache_set(struct cache_set *c)
 
 void bch_debug_exit(void)
 {
-       if (!IS_ERR_OR_NULL(bcache_debug))
-               debugfs_remove_recursive(bcache_debug);
+       debugfs_remove_recursive(bcache_debug);
 }
 
 void __init bch_debug_init(void)
index 7bbd670..5b59d44 100644 (file)
@@ -1510,8 +1510,7 @@ static void cache_set_free(struct closure *cl)
        struct cache *ca;
        unsigned int i;
 
-       if (!IS_ERR_OR_NULL(c->debug))
-               debugfs_remove(c->debug);
+       debugfs_remove(c->debug);
 
        bch_open_buckets_free(c);
        bch_btree_cache_free(c);