aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/debug.c
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2018-08-09 03:48:42 -0400
committerJens Axboe <axboe@kernel.dk>2018-08-09 10:21:01 -0400
commit78ac2107176baa0daf65b0fb8e561d2ed14c83ca (patch)
tree1569ae7f55d6a742a426a51387c8f0382be2abfc /drivers/md/bcache/debug.c
parenta12fc00b237c25519cc861b56dd4ca41bbec4ed3 (diff)
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/debug.c')
-rw-r--r--drivers/md/bcache/debug.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
index 04d146711950..12034c07257b 100644
--- a/drivers/md/bcache/debug.c
+++ b/drivers/md/bcache/debug.c
@@ -252,11 +252,12 @@ void bch_debug_exit(void)
252 debugfs_remove_recursive(bcache_debug); 252 debugfs_remove_recursive(bcache_debug);
253} 253}
254 254
255int __init bch_debug_init(struct kobject *kobj) 255void __init bch_debug_init(struct kobject *kobj)
256{ 256{
257 if (!IS_ENABLED(CONFIG_DEBUG_FS)) 257 /*
258 return 0; 258 * it is unnecessary to check return value of
259 259 * debugfs_create_file(), we should not care
260 * about this.
261 */
260 bcache_debug = debugfs_create_dir("bcache", NULL); 262 bcache_debug = debugfs_create_dir("bcache", NULL);
261 return IS_ERR_OR_NULL(bcache_debug);
262} 263}