Skip to content

Commit 352bce2

Browse files
committed
lib: 842: 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: Haren Myneni <[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 d03ae47 commit 352bce2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/842/842_debugfs.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ static int __init sw842_debugfs_create(void)
2222
return -ENODEV;
2323

2424
sw842_debugfs_root = debugfs_create_dir(MODULE_NAME, NULL);
25-
if (IS_ERR(sw842_debugfs_root))
26-
return PTR_ERR(sw842_debugfs_root);
2725

2826
for (i = 0; i < ARRAY_SIZE(template_count); i++) {
2927
char name[32];
@@ -46,8 +44,7 @@ static int __init sw842_debugfs_create(void)
4644

4745
static void __exit sw842_debugfs_remove(void)
4846
{
49-
if (sw842_debugfs_root && !IS_ERR(sw842_debugfs_root))
50-
debugfs_remove_recursive(sw842_debugfs_root);
47+
debugfs_remove_recursive(sw842_debugfs_root);
5148
}
5249

5350
#endif

0 commit comments

Comments
 (0)