From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@ziepe.ca>
Cc: linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Leon Romanovsky <leon@kernel.org>,
Kamal Heib <kamalheib1@gmail.com>,
Denis Drozdov <denisd@mellanox.com>,
Saeed Mahameed <saeedm@mellanox.com>,
Erez Shitrit <erezsh@mellanox.com>,
Yuval Shaia <yuval.shaia@oracle.com>,
Dennis Dalessandro <dennis.dalessandro@intel.com>,
Alaa Hleihel <alaa@mellanox.com>,
Parav Pandit <parav@mellanox.com>,
Kees Cook <keescook@chromium.org>,
Arseny Maslennikov <ar@cs.msu.ru>,
Evgenii Smirnov <evgenii.smirnov@profitbricks.com>
Subject: [PATCH 8/8] infiniband: ipoib: no need to check return value of debugfs_create functions
Date: Tue, 22 Jan 2019 16:18:00 +0100 [thread overview]
Message-ID: <20190122151800.15092-9-gregkh@linuxfoundation.org> (raw)
In-Reply-To: <20190122151800.15092-1-gregkh@linuxfoundation.org>
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: Doug Ledford <dledford@redhat.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Kamal Heib <kamalheib1@gmail.com>
Cc: Denis Drozdov <denisd@mellanox.com>
Cc: Saeed Mahameed <saeedm@mellanox.com>
Cc: Erez Shitrit <erezsh@mellanox.com>
Cc: Yuval Shaia <yuval.shaia@oracle.com>
Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
Cc: Alaa Hleihel <alaa@mellanox.com>
Cc: Parav Pandit <parav@mellanox.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Arseny Maslennikov <ar@cs.msu.ru>
Cc: Evgenii Smirnov <evgenii.smirnov@profitbricks.com>
Cc: linux-rdma@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/ulp/ipoib/ipoib.h | 4 ++--
drivers/infiniband/ulp/ipoib/ipoib_fs.c | 7 +------
drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 +---
3 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h
index 1da119d901a9..5941d660add1 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib.h
+++ b/drivers/infiniband/ulp/ipoib/ipoib.h
@@ -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
void ipoib_create_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);
#else
static inline void ipoib_create_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) { }
#endif
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_fs.c b/drivers/infiniband/ulp/ipoib/ipoib_fs.c
index 178488028734..64c19f6fa931 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_fs.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_fs.c
@@ -267,14 +267,10 @@ void ipoib_create_debug_files(struct net_device *dev)
snprintf(name, sizeof(name), "%s_mcg", dev->name);
priv->mcg_dentry = debugfs_create_file(name, S_IFREG | S_IRUGO,
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);
priv->path_dentry = debugfs_create_file(name, S_IFREG | S_IRUGO,
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)
@@ -286,10 +282,9 @@ void ipoib_delete_debug_files(struct net_device *dev)
priv->mcg_dentry = priv->path_dentry = NULL;
}
-int ipoib_register_debugfs(void)
+void ipoib_register_debugfs(void)
{
ipoib_root = debugfs_create_dir("ipoib", NULL);
- return ipoib_root ? 0 : -ENOMEM;
}
void ipoib_unregister_debugfs(void)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index d932f99201d1..45ef3b0f03c5 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -2577,9 +2577,7 @@ static int __init ipoib_init_module(void)
*/
BUILD_BUG_ON(IPOIB_CM_COPYBREAK > IPOIB_CM_HEAD_SIZE);
- ret = ipoib_register_debugfs();
- if (ret)
- return ret;
+ ipoib_register_debugfs();
/*
* We create a global workqueue here that is used for all flush
--
2.20.1
next prev parent reply other threads:[~2019-01-22 15:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-22 15:17 [PATCH 0/8] IB: cleanup debugfs usage Greg Kroah-Hartman
2019-01-22 15:17 ` [PATCH 1/8] infiniband: cxgb4: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-01-22 16:22 ` Steve Wise
2019-01-22 16:30 ` Greg Kroah-Hartman
2019-01-22 15:17 ` [PATCH 2/8] infiniband: hfi1: drop crazy DEBUGFS_SEQ_FILE_CREATE() macro Greg Kroah-Hartman
2019-01-22 15:17 ` [PATCH 3/8] infiniband: hfi1: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-01-22 15:17 ` [PATCH 4/8] infiniband: qib: " Greg Kroah-Hartman
2019-01-22 15:17 ` [PATCH 5/8] infiniband: mlx5: " Greg Kroah-Hartman
2019-01-22 17:42 ` Leon Romanovsky
2019-01-22 15:17 ` [PATCH 6/8] infiniband: ocrdma: " Greg Kroah-Hartman
2019-01-22 15:17 ` [PATCH 7/8] infiniband: usnic: " Greg Kroah-Hartman
2019-01-23 0:16 ` Parvi Kaustubhi (pkaustub)
2019-01-22 15:18 ` Greg Kroah-Hartman [this message]
2019-01-23 21:15 ` [PATCH 0/8] IB: cleanup debugfs usage Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190122151800.15092-9-gregkh@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=alaa@mellanox.com \
--cc=ar@cs.msu.ru \
--cc=denisd@mellanox.com \
--cc=dennis.dalessandro@intel.com \
--cc=dledford@redhat.com \
--cc=erezsh@mellanox.com \
--cc=evgenii.smirnov@profitbricks.com \
--cc=jgg@ziepe.ca \
--cc=kamalheib1@gmail.com \
--cc=keescook@chromium.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=parav@mellanox.com \
--cc=saeedm@mellanox.com \
--cc=yuval.shaia@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox