fjes: no need to check return value of debugfs_create functions
Subsystems (2)
PATCH 1/1 fjes: 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 "David S. Miller" <[email protected]>
Cc Yangtao Li <[email protected]>
Signed-off-by Greg Kroah-Hartman <[email protected]>
--- drivers/net/fjes/fjes_debugfs.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)
drivers/net/fjes/fjes_debugfs.c +2 -13
@@ -67,20 +67,11 @@ DEFINE_SHOW_ATTRIBUTE(fjes_dbg_status);void fjes_dbg_adapter_init (struct fjes_adapter *adapter) {const char *name =dev_name (&adapter->plat_dev->dev); -struct dentry *pfile; adapter->dbg_adapter =debugfs_create_dir (name, fjes_debug_root); -if (!adapter->dbg_adapter) { -dev_err (&adapter->plat_dev->dev, -"debugfs entry for %s failed\n" , name); -return ; - } - pfile =debugfs_create_file ("status" ,0444 , adapter->dbg_adapter, - adapter, &fjes_dbg_status_fops); -if (!pfile) -dev_err (&adapter->plat_dev->dev, -"debugfs status for %s failed\n" , name); +debugfs_create_file ("status" ,0444 , adapter->dbg_adapter, adapter, + &fjes_dbg_status_fops); }void fjes_dbg_adapter_exit (struct fjes_adapter *adapter)
@@ -92,8 +83,6 @@ void fjes_dbg_adapter_exit(struct fjes_adapter *adapter)void fjes_dbg_init (void ) { fjes_debug_root =debugfs_create_dir (fjes_driver_name,NULL ); -if (!fjes_debug_root) -pr_info ("init of debugfs failed\n" ); }void fjes_dbg_exit (void )
Signature · 1 line
2.22.0
From: Greg Kroah-Hartman <[email protected]>
Date: Thu, 20 Jun 2019 09:31:06 +0200
Quoted 8 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.
Cc "David S. Miller" <[email protected]>Cc Yangtao Li <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Applied to net-next, thanks Greg.