2018-09-08 13:42:56

by zhong jiang

[permalink] [raw]
Subject: [PATCH] bcache: remove unecessary condition check before debugfs_remove_recursive

debugfs_remove_recursive has taken IS_ERR_OR_NULL into account. So just
remove the condition check before debugfs_remove_recursive.

Signed-off-by: zhong jiang <[email protected]>
---
drivers/md/bcache/debug.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
index 06da66b..8c53d87 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)
--
1.7.12.4



2018-09-10 02:31:10

by Junhui Tang

[permalink] [raw]
Subject: Re: [PATCH] bcache: remove unecessary condition check before debugfs_remove_recursive

LGTM

Reviewed-by: [email protected]
zhong jiang <[email protected]> 于2018年9月8日周六 下午9:41写道:
>
> debugfs_remove_recursive has taken IS_ERR_OR_NULL into account. So just
> remove the condition check before debugfs_remove_recursive.
>
> Signed-off-by: zhong jiang <[email protected]>
> ---
> drivers/md/bcache/debug.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
> index 06da66b..8c53d87 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)
> --
> 1.7.12.4
>