From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH v2 16/17] ixgbe: no need to check return value of debugfs_create functions
Date: Fri, 9 Aug 2019 14:31:07 +0200 [thread overview]
Message-ID: <20190809123108.27065-17-gregkh@linuxfoundation.org> (raw)
In-Reply-To: <20190809123108.27065-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: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
.../net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 22 +++++--------------
1 file changed, 5 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
index 50dfb02fa34c..171cdc552961 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
@@ -190,22 +190,12 @@ static const struct file_operations ixgbe_dbg_netdev_ops_fops = {
void ixgbe_dbg_adapter_init(struct ixgbe_adapter *adapter)
{
const char *name = pci_name(adapter->pdev);
- struct dentry *pfile;
+
adapter->ixgbe_dbg_adapter = debugfs_create_dir(name, ixgbe_dbg_root);
- if (adapter->ixgbe_dbg_adapter) {
- pfile = debugfs_create_file("reg_ops", 0600,
- adapter->ixgbe_dbg_adapter, adapter,
- &ixgbe_dbg_reg_ops_fops);
- if (!pfile)
- e_dev_err("debugfs reg_ops for %s failed\n", name);
- pfile = debugfs_create_file("netdev_ops", 0600,
- adapter->ixgbe_dbg_adapter, adapter,
- &ixgbe_dbg_netdev_ops_fops);
- if (!pfile)
- e_dev_err("debugfs netdev_ops for %s failed\n", name);
- } else {
- e_dev_err("debugfs entry for %s failed\n", name);
- }
+ debugfs_create_file("reg_ops", 0600, adapter->ixgbe_dbg_adapter,
+ adapter, &ixgbe_dbg_reg_ops_fops);
+ debugfs_create_file("netdev_ops", 0600, adapter->ixgbe_dbg_adapter,
+ adapter, &ixgbe_dbg_netdev_ops_fops);
}
/**
@@ -224,8 +214,6 @@ void ixgbe_dbg_adapter_exit(struct ixgbe_adapter *adapter)
void ixgbe_dbg_init(void)
{
ixgbe_dbg_root = debugfs_create_dir(ixgbe_driver_name, NULL);
- if (ixgbe_dbg_root == NULL)
- pr_err("init of debugfs failed\n");
}
/**
--
2.22.0
WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: netdev@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
"David S. Miller" <davem@davemloft.net>,
intel-wired-lan@lists.osuosl.org
Subject: [PATCH v2 16/17] ixgbe: no need to check return value of debugfs_create functions
Date: Fri, 9 Aug 2019 14:31:07 +0200 [thread overview]
Message-ID: <20190809123108.27065-17-gregkh@linuxfoundation.org> (raw)
In-Reply-To: <20190809123108.27065-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: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
.../net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 22 +++++--------------
1 file changed, 5 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
index 50dfb02fa34c..171cdc552961 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
@@ -190,22 +190,12 @@ static const struct file_operations ixgbe_dbg_netdev_ops_fops = {
void ixgbe_dbg_adapter_init(struct ixgbe_adapter *adapter)
{
const char *name = pci_name(adapter->pdev);
- struct dentry *pfile;
+
adapter->ixgbe_dbg_adapter = debugfs_create_dir(name, ixgbe_dbg_root);
- if (adapter->ixgbe_dbg_adapter) {
- pfile = debugfs_create_file("reg_ops", 0600,
- adapter->ixgbe_dbg_adapter, adapter,
- &ixgbe_dbg_reg_ops_fops);
- if (!pfile)
- e_dev_err("debugfs reg_ops for %s failed\n", name);
- pfile = debugfs_create_file("netdev_ops", 0600,
- adapter->ixgbe_dbg_adapter, adapter,
- &ixgbe_dbg_netdev_ops_fops);
- if (!pfile)
- e_dev_err("debugfs netdev_ops for %s failed\n", name);
- } else {
- e_dev_err("debugfs entry for %s failed\n", name);
- }
+ debugfs_create_file("reg_ops", 0600, adapter->ixgbe_dbg_adapter,
+ adapter, &ixgbe_dbg_reg_ops_fops);
+ debugfs_create_file("netdev_ops", 0600, adapter->ixgbe_dbg_adapter,
+ adapter, &ixgbe_dbg_netdev_ops_fops);
}
/**
@@ -224,8 +214,6 @@ void ixgbe_dbg_adapter_exit(struct ixgbe_adapter *adapter)
void ixgbe_dbg_init(void)
{
ixgbe_dbg_root = debugfs_create_dir(ixgbe_driver_name, NULL);
- if (ixgbe_dbg_root == NULL)
- pr_err("init of debugfs failed\n");
}
/**
--
2.22.0
next prev parent reply other threads:[~2019-08-09 12:31 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-09 12:30 [PATCH v2 00/17] Networking driver debugfs cleanups Greg Kroah-Hartman
2019-08-09 12:30 ` [PATCH v2 01/17] wimax: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-08-09 12:30 ` [PATCH v2 02/17] bonding: no need to print a message if debugfs_create_dir() fails Greg Kroah-Hartman
2019-08-09 12:30 ` [PATCH v2 03/17] mlx5: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-08-09 12:30 ` [PATCH v2 04/17] xgbe: " Greg Kroah-Hartman
2019-08-09 12:30 ` [PATCH v2 05/17] bnxt: " Greg Kroah-Hartman
2019-08-09 12:30 ` [PATCH v2 06/17] cxgb4: " Greg Kroah-Hartman
2019-08-09 12:30 ` [PATCH v2 07/17] hns3: " Greg Kroah-Hartman
2019-08-09 12:30 ` [PATCH v2 08/17] nfp: " Greg Kroah-Hartman
2019-08-09 17:10 ` Jakub Kicinski
2019-08-09 12:31 ` [PATCH v2 09/17] stmmac: " Greg Kroah-Hartman
2019-08-09 12:31 ` [PATCH v2 10/17] dpaa2: " Greg Kroah-Hartman
2019-08-09 12:31 ` [PATCH v2 11/17] qca: " Greg Kroah-Hartman
2019-08-09 12:31 ` [PATCH v2 12/17] skge: " Greg Kroah-Hartman
2019-08-09 12:31 ` [PATCH v2 13/17] mvpp2: " Greg Kroah-Hartman
2019-08-09 12:31 ` [Intel-wired-lan] [PATCH v2 14/17] fm10k: " Greg Kroah-Hartman
2019-08-09 12:31 ` Greg Kroah-Hartman
2019-08-09 12:31 ` [Intel-wired-lan] [PATCH v2 15/17] i40e: " Greg Kroah-Hartman
2019-08-09 12:31 ` Greg Kroah-Hartman
2019-08-09 12:31 ` Greg Kroah-Hartman [this message]
2019-08-09 12:31 ` [PATCH v2 16/17] ixgbe: " Greg Kroah-Hartman
2019-08-09 12:31 ` [PATCH v2 17/17] ieee802154: " Greg Kroah-Hartman
2019-08-09 12:34 ` Hennerich, Michael
2019-08-09 18:20 ` [PATCH v2 00/17] Networking driver debugfs cleanups David Miller
2019-08-10 10:17 ` Greg KH
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=20190809123108.27065-17-gregkh@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=intel-wired-lan@osuosl.org \
/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 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.