aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/debug.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-04 08:26:18 -0500
committerJaegeuk Kim <jaegeuk@kernel.org>2019-01-08 23:41:09 -0500
commitc20e57b32d817d35271c4b205cb6ab80d8d93aeb (patch)
tree556e4c65e7e6286cbc3efeba0444600762badf6c /fs/f2fs/debug.c
parent5d539245cb18afa8943cbf2be0cdc033e49f3a4a (diff)
f2fs: no need to check return value of debugfs_create functions
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Jaegeuk Kim <jaegeuk@kernel.org> Cc: Chao Yu <yuchao0@huawei.com> Cc: linux-f2fs-devel@lists.sourceforge.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/debug.c')
-rw-r--r--fs/f2fs/debug.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index 503fde8349e6..99e9a5c37b71 100644
--- a/fs/f2fs/debug.c
+++ b/fs/f2fs/debug.c
@@ -511,30 +511,16 @@ void f2fs_destroy_stats(struct f2fs_sb_info *sbi)
511 kvfree(si); 511 kvfree(si);
512} 512}
513 513
514int __init f2fs_create_root_stats(void) 514void __init f2fs_create_root_stats(void)
515{ 515{
516 struct dentry *file;
517
518 f2fs_debugfs_root = debugfs_create_dir("f2fs", NULL); 516 f2fs_debugfs_root = debugfs_create_dir("f2fs", NULL);
519 if (!f2fs_debugfs_root)
520 return -ENOMEM;
521 517
522 file = debugfs_create_file("status", S_IRUGO, f2fs_debugfs_root, 518 debugfs_create_file("status", S_IRUGO, f2fs_debugfs_root, NULL,
523 NULL, &stat_fops); 519 &stat_fops);
524 if (!file) {
525 debugfs_remove(f2fs_debugfs_root);
526 f2fs_debugfs_root = NULL;
527 return -ENOMEM;
528 }
529
530 return 0;
531} 520}
532 521
533void f2fs_destroy_root_stats(void) 522void f2fs_destroy_root_stats(void)
534{ 523{
535 if (!f2fs_debugfs_root)
536 return;
537
538 debugfs_remove_recursive(f2fs_debugfs_root); 524 debugfs_remove_recursive(f2fs_debugfs_root);
539 f2fs_debugfs_root = NULL; 525 f2fs_debugfs_root = NULL;
540} 526}