Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
lib: 842: no need to check return value of debugfs_create functions
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
gregkh committed Jul 3, 2019
1 parent d03ae47 commit 352bce2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/842/842_debugfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ static int __init sw842_debugfs_create(void)
return -ENODEV;

sw842_debugfs_root = debugfs_create_dir(MODULE_NAME, NULL);
if (IS_ERR(sw842_debugfs_root))
return PTR_ERR(sw842_debugfs_root);

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

static void __exit sw842_debugfs_remove(void)
{
if (sw842_debugfs_root && !IS_ERR(sw842_debugfs_root))
debugfs_remove_recursive(sw842_debugfs_root);
debugfs_remove_recursive(sw842_debugfs_root);
}

#endif

0 comments on commit 352bce2

Please sign in to comment.