Skip to contentSkip to conversation

xen-netback: no need to check return value of debugfs_create functions

PATCH Applied Greg Kroah-Hartman 3 participants 3 messages Aug 10, 2019 – Aug 12, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen-netback: 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.

---
 drivers/net/xen-netback/netback.c |  3 --
 drivers/net/xen-netback/xenbus.c  | 46 ++++++++-----------------------
 2 files changed, 11 insertions(+), 38 deletions(-)
drivers/net/xen-netback/netback.c +0 -3
index 1d9940d4e8c7..e018932abf49 100644
@@ -1653,9 +1653,6 @@ static int __init netback_init(void)
 
 #ifdef CONFIG_DEBUG_FS
 	xen_netback_dbg_root = debugfs_create_dir("xen-netback", NULL);
-	if (IS_ERR_OR_NULL(xen_netback_dbg_root))
-		pr_warn("Init of debugfs returned %ld!\n",
-			PTR_ERR(xen_netback_dbg_root));
 #endif /* CONFIG_DEBUG_FS */
 
 	return 0;
drivers/net/xen-netback/xenbus.c +11 -35

61 lines not on this page · raw message

Signature · 1 line
2.22.0
maintainer Applied
#2 lore raw
In reply to Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>
Date: Sat, 10 Aug 2019 12:31:08 +0200

Quoted 9 lines

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.

Applied to net-next.