diff options
author | Coly Li <colyli@suse.de> | 2018-08-09 09:48:42 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-08-09 16:21:01 +0200 |
commit | 78ac2107176baa0daf65b0fb8e561d2ed14c83ca (patch) | |
tree | 1569ae7f55d6a742a426a51387c8f0382be2abfc /drivers/md/bcache/closure.c | |
parent | drivers/block/drbd: remove the null check for kmem_cache_destroy (diff) | |
download | linux-78ac2107176baa0daf65b0fb8e561d2ed14c83ca.tar.xz linux-78ac2107176baa0daf65b0fb8e561d2ed14c83ca.zip |
bcache: do not check return value of debugfs_create_dir()
Greg KH suggests that normal code should not care about debugfs. Therefore
no matter successful or failed of debugfs_create_dir() execution, it is
unncessary to check its return value.
There are two functions called debugfs_create_dir() and check the return
value, which are bch_debug_init() and closure_debug_init(). This patch
changes these two functions from int to void type, and ignore return values
of debugfs_create_dir().
This patch does not fix exact bug, just makes things work as they should.
Signed-off-by: Coly Li <colyli@suse.de>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable@vger.kernel.org
Cc: Kai Krakow <kai@kaishome.de>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache/closure.c')
-rw-r--r-- | drivers/md/bcache/closure.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/md/bcache/closure.c b/drivers/md/bcache/closure.c index 0e14969182c6..618253683d40 100644 --- a/drivers/md/bcache/closure.c +++ b/drivers/md/bcache/closure.c @@ -199,11 +199,16 @@ static const struct file_operations debug_ops = { .release = single_release }; -int __init closure_debug_init(void) +void __init closure_debug_init(void) { - closure_debug = debugfs_create_file("closures", - 0400, bcache_debug, NULL, &debug_ops); - return IS_ERR_OR_NULL(closure_debug); + if (!IS_ERR_OR_NULL(bcache_debug)) + /* + * it is unnecessary to check return value of + * debugfs_create_file(), we should not care + * about this. + */ + closure_debug = debugfs_create_file( + "closures", 0400, bcache_debug, NULL, &debug_ops); } #endif |