All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib: 842: no need to check return value of debugfs_create functions
@ 2019-06-12 15:34 Greg Kroah-Hartman
  0 siblings, 0 replies; only message in thread
From: Greg Kroah-Hartman @ 2019-06-12 15:34 UTC (permalink / raw)
  To: Haren Myneni; +Cc: linux-kernel

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 <haren@us.ibm.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 lib/842/842_debugfs.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/842/842_debugfs.h b/lib/842/842_debugfs.h
index 277e403e8701..4469407c3e0d 100644
--- a/lib/842/842_debugfs.h
+++ b/lib/842/842_debugfs.h
@@ -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];
@@ -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
-- 
2.22.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-06-12 15:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-12 15:34 [PATCH] lib: 842: no need to check return value of debugfs_create functions Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.