Skip to content

Commit f095adb

Browse files
committed
orangefs: 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: Mike Marshall <[email protected]> Cc: Martin Brandenburg <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 15b6ff9 commit f095adb

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

fs/orangefs/orangefs-debugfs.c

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ static char *debug_help_string;
9999
static char client_debug_string[ORANGEFS_MAX_DEBUG_STRING_LEN];
100100
static char client_debug_array_string[ORANGEFS_MAX_DEBUG_STRING_LEN];
101101

102-
static struct dentry *help_file_dentry;
103102
static struct dentry *client_debug_dentry;
104103
static struct dentry *debug_dir;
105104

@@ -183,20 +182,9 @@ int orangefs_debugfs_init(int debug_mask)
183182
(unsigned long long)orangefs_gossip_debug_mask);
184183

185184
debug_dir = debugfs_create_dir("orangefs", NULL);
186-
if (!debug_dir) {
187-
pr_info("%s: debugfs_create_dir failed.\n", __func__);
188-
goto out;
189-
}
190185

191-
help_file_dentry = debugfs_create_file(ORANGEFS_KMOD_DEBUG_HELP_FILE,
192-
0444,
193-
debug_dir,
194-
debug_help_string,
195-
&debug_help_fops);
196-
if (!help_file_dentry) {
197-
pr_info("%s: debugfs_create_file failed.\n", __func__);
198-
goto out;
199-
}
186+
debugfs_create_file(ORANGEFS_KMOD_DEBUG_HELP_FILE, 0444, debug_dir,
187+
debug_help_string, &debug_help_fops);
200188

201189
orangefs_debug_disabled = 0;
202190

@@ -230,17 +218,8 @@ static int orangefs_kernel_debug_init(void)
230218
pr_info("%s: overflow 1!\n", __func__);
231219
}
232220

233-
ret = debugfs_create_file(ORANGEFS_KMOD_DEBUG_FILE,
234-
0444,
235-
debug_dir,
236-
k_buffer,
237-
&kernel_debug_fops);
238-
if (!ret) {
239-
pr_info("%s: failed to create %s.\n",
240-
__func__,
241-
ORANGEFS_KMOD_DEBUG_FILE);
242-
goto out;
243-
}
221+
debugfs_create_file(ORANGEFS_KMOD_DEBUG_FILE, 0444, debug_dir, k_buffer,
222+
&kernel_debug_fops);
244223

245224
rc = 0;
246225

@@ -353,12 +332,6 @@ static int orangefs_client_debug_init(void)
353332
debug_dir,
354333
c_buffer,
355334
&kernel_debug_fops);
356-
if (!client_debug_dentry) {
357-
pr_info("%s: failed to create updated %s.\n",
358-
__func__,
359-
ORANGEFS_CLIENT_DEBUG_FILE);
360-
goto out;
361-
}
362335

363336
rc = 0;
364337

0 commit comments

Comments
 (0)