Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

btrfs: 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: Chris Mason <clm@fb.com>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: David Sterba <dsterba@suse.com>
Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+2 -8
+2 -8
fs/btrfs/sysfs.c
··· 910 910 ret = sysfs_create_group(fsid_kobj, &btrfs_feature_attr_group); 911 911 } 912 912 913 - static int btrfs_init_debugfs(void) 913 + static void btrfs_init_debugfs(void) 914 914 { 915 915 #ifdef CONFIG_DEBUG_FS 916 916 btrfs_debugfs_root_dentry = debugfs_create_dir("btrfs", NULL); 917 - if (!btrfs_debugfs_root_dentry) 918 - return -ENOMEM; 919 917 920 918 /* 921 919 * Example code, how to export data through debugfs. ··· 927 929 #endif 928 930 929 931 #endif 930 - return 0; 931 932 } 932 933 933 934 int __init btrfs_init_sysfs(void) ··· 937 940 if (!btrfs_kset) 938 941 return -ENOMEM; 939 942 940 - ret = btrfs_init_debugfs(); 941 - if (ret) 942 - goto out1; 943 + btrfs_init_debugfs(); 943 944 944 945 init_feature_attrs(); 945 946 ret = sysfs_create_group(&btrfs_kset->kobj, &btrfs_feature_attr_group); ··· 954 959 sysfs_remove_group(&btrfs_kset->kobj, &btrfs_feature_attr_group); 955 960 out2: 956 961 debugfs_remove_recursive(btrfs_debugfs_root_dentry); 957 - out1: 958 962 kset_unregister(btrfs_kset); 959 963 960 964 return ret;