summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorShenghui Wang <shhuiw@foxmail.com>2018-12-13 17:53:47 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-05 11:20:07 +0300
commit6f48e23888b92cacab7c610a6220429256b348cf (patch)
treef6789bd2fed492004125163087a46b27503b0a07 /drivers/md
parentc318f88411a8e69891c691c07b508c4b77772e54 (diff)
downloadlinux-6f48e23888b92cacab7c610a6220429256b348cf.tar.xz
bcache: do not check if debug dentry is ERR or NULL explicitly on remove
[ Upstream commit ae17102316550b4b230a283febe31b2a9ff30084 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/bcache/debug.c3
-rw-r--r--drivers/md/bcache/super.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
index 06da66b2488a..8c53d874ada4 100644
--- a/drivers/md/bcache/debug.c
+++ b/drivers/md/bcache/debug.c
@@ -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(struct kobject *kobj)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 4998b4cae9c1..14d381cc6d74 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1491,8 +1491,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);