Commit 2e061c69 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Jason Gunthorpe

infiniband: ipoib: 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.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 316bcda8
...@@ -781,12 +781,12 @@ static inline void ipoib_cm_handle_tx_wc(struct net_device *dev, struct ib_wc *w ...@@ -781,12 +781,12 @@ static inline void ipoib_cm_handle_tx_wc(struct net_device *dev, struct ib_wc *w
#ifdef CONFIG_INFINIBAND_IPOIB_DEBUG #ifdef CONFIG_INFINIBAND_IPOIB_DEBUG
void ipoib_create_debug_files(struct net_device *dev); void ipoib_create_debug_files(struct net_device *dev);
void ipoib_delete_debug_files(struct net_device *dev); void ipoib_delete_debug_files(struct net_device *dev);
int ipoib_register_debugfs(void); void ipoib_register_debugfs(void);
void ipoib_unregister_debugfs(void); void ipoib_unregister_debugfs(void);
#else #else
static inline void ipoib_create_debug_files(struct net_device *dev) { } static inline void ipoib_create_debug_files(struct net_device *dev) { }
static inline void ipoib_delete_debug_files(struct net_device *dev) { } static inline void ipoib_delete_debug_files(struct net_device *dev) { }
static inline int ipoib_register_debugfs(void) { return 0; } static inline void ipoib_register_debugfs(void) { }
static inline void ipoib_unregister_debugfs(void) { } static inline void ipoib_unregister_debugfs(void) { }
#endif #endif
......
...@@ -267,14 +267,10 @@ void ipoib_create_debug_files(struct net_device *dev) ...@@ -267,14 +267,10 @@ void ipoib_create_debug_files(struct net_device *dev)
snprintf(name, sizeof(name), "%s_mcg", dev->name); snprintf(name, sizeof(name), "%s_mcg", dev->name);
priv->mcg_dentry = debugfs_create_file(name, S_IFREG | S_IRUGO, priv->mcg_dentry = debugfs_create_file(name, S_IFREG | S_IRUGO,
ipoib_root, dev, &ipoib_mcg_fops); ipoib_root, dev, &ipoib_mcg_fops);
if (!priv->mcg_dentry)
ipoib_warn(priv, "failed to create mcg debug file\n");
snprintf(name, sizeof(name), "%s_path", dev->name); snprintf(name, sizeof(name), "%s_path", dev->name);
priv->path_dentry = debugfs_create_file(name, S_IFREG | S_IRUGO, priv->path_dentry = debugfs_create_file(name, S_IFREG | S_IRUGO,
ipoib_root, dev, &ipoib_path_fops); ipoib_root, dev, &ipoib_path_fops);
if (!priv->path_dentry)
ipoib_warn(priv, "failed to create path debug file\n");
} }
void ipoib_delete_debug_files(struct net_device *dev) void ipoib_delete_debug_files(struct net_device *dev)
...@@ -286,10 +282,9 @@ void ipoib_delete_debug_files(struct net_device *dev) ...@@ -286,10 +282,9 @@ void ipoib_delete_debug_files(struct net_device *dev)
priv->mcg_dentry = priv->path_dentry = NULL; priv->mcg_dentry = priv->path_dentry = NULL;
} }
int ipoib_register_debugfs(void) void ipoib_register_debugfs(void)
{ {
ipoib_root = debugfs_create_dir("ipoib", NULL); ipoib_root = debugfs_create_dir("ipoib", NULL);
return ipoib_root ? 0 : -ENOMEM;
} }
void ipoib_unregister_debugfs(void) void ipoib_unregister_debugfs(void)
......
...@@ -2577,9 +2577,7 @@ static int __init ipoib_init_module(void) ...@@ -2577,9 +2577,7 @@ static int __init ipoib_init_module(void)
*/ */
BUILD_BUG_ON(IPOIB_CM_COPYBREAK > IPOIB_CM_HEAD_SIZE); BUILD_BUG_ON(IPOIB_CM_COPYBREAK > IPOIB_CM_HEAD_SIZE);
ret = ipoib_register_debugfs(); ipoib_register_debugfs();
if (ret)
return ret;
/* /*
* We create a global workqueue here that is used for all flush * We create a global workqueue here that is used for all flush
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment