All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: netdev@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"David S. Miller" <davem@davemloft.net>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Nathan Huckleberry <nhuck@google.com>
Subject: [PATCH v3 13/17] mvpp2: no need to check return value of debugfs_create functions
Date: Sat, 10 Aug 2019 12:17:28 +0200	[thread overview]
Message-ID: <20190810101732.26612-14-gregkh@linuxfoundation.org> (raw)
In-Reply-To: <20190810101732.26612-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: "David S. Miller" <davem@davemloft.net>
Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Nathan Huckleberry <nhuck@google.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 .../ethernet/marvell/mvpp2/mvpp2_debugfs.c    | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c
index 274fb07362cb..4a3baa7e0142 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c
@@ -452,8 +452,6 @@ static int mvpp2_dbgfs_flow_port_init(struct dentry *parent,
 	struct dentry *port_dir;
 
 	port_dir = debugfs_create_dir(port->dev->name, parent);
-	if (IS_ERR(port_dir))
-		return PTR_ERR(port_dir);
 
 	port_entry = &port->priv->dbgfs_entries->port_flow_entries[port->id];
 
@@ -480,8 +478,6 @@ static int mvpp2_dbgfs_flow_entry_init(struct dentry *parent,
 	sprintf(flow_entry_name, "%02d", flow);
 
 	flow_entry_dir = debugfs_create_dir(flow_entry_name, parent);
-	if (!flow_entry_dir)
-		return -ENOMEM;
 
 	entry = &priv->dbgfs_entries->flow_entries[flow];
 
@@ -514,8 +510,6 @@ static int mvpp2_dbgfs_flow_init(struct dentry *parent, struct mvpp2 *priv)
 	int i, ret;
 
 	flow_dir = debugfs_create_dir("flows", parent);
-	if (!flow_dir)
-		return -ENOMEM;
 
 	for (i = 0; i < MVPP2_N_PRS_FLOWS; i++) {
 		ret = mvpp2_dbgfs_flow_entry_init(flow_dir, priv, i);
@@ -539,8 +533,6 @@ static int mvpp2_dbgfs_prs_entry_init(struct dentry *parent,
 	sprintf(prs_entry_name, "%03d", tid);
 
 	prs_entry_dir = debugfs_create_dir(prs_entry_name, parent);
-	if (!prs_entry_dir)
-		return -ENOMEM;
 
 	entry = &priv->dbgfs_entries->prs_entries[tid];
 
@@ -578,8 +570,6 @@ static int mvpp2_dbgfs_prs_init(struct dentry *parent, struct mvpp2 *priv)
 	int i, ret;
 
 	prs_dir = debugfs_create_dir("parser", parent);
-	if (!prs_dir)
-		return -ENOMEM;
 
 	for (i = 0; i < MVPP2_PRS_TCAM_SRAM_SIZE; i++) {
 		ret = mvpp2_dbgfs_prs_entry_init(prs_dir, priv, i);
@@ -688,8 +678,6 @@ static int mvpp2_dbgfs_port_init(struct dentry *parent,
 	struct dentry *port_dir;
 
 	port_dir = debugfs_create_dir(port->dev->name, parent);
-	if (IS_ERR(port_dir))
-		return PTR_ERR(port_dir);
 
 	debugfs_create_file("parser_entries", 0444, port_dir, port,
 			    &mvpp2_dbgfs_port_parser_fops);
@@ -716,15 +704,10 @@ void mvpp2_dbgfs_init(struct mvpp2 *priv, const char *name)
 	int ret, i;
 
 	mvpp2_root = debugfs_lookup(MVPP2_DRIVER_NAME, NULL);
-	if (!mvpp2_root) {
+	if (!mvpp2_root)
 		mvpp2_root = debugfs_create_dir(MVPP2_DRIVER_NAME, NULL);
-		if (IS_ERR(mvpp2_root))
-			return;
-	}
 
 	mvpp2_dir = debugfs_create_dir(name, mvpp2_root);
-	if (IS_ERR(mvpp2_dir))
-		return;
 
 	priv->dbgfs_dir = mvpp2_dir;
 	priv->dbgfs_entries = kzalloc(sizeof(*priv->dbgfs_entries), GFP_KERNEL);
-- 
2.22.0


  parent reply	other threads:[~2019-08-10 10:17 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-10 10:17 [PATCH v3 00/17] Networking driver debugfs cleanups Greg Kroah-Hartman
2019-08-10 10:17 ` [PATCH v3 01/17] wimax: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-08-10 10:17 ` [PATCH v3 02/17] bonding: no need to print a message if debugfs_create_dir() fails Greg Kroah-Hartman
2019-08-10 10:17 ` [PATCH v3 03/17] mlx5: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-08-10 10:17 ` [PATCH v3 04/17] xgbe: " Greg Kroah-Hartman
2019-08-10 10:17 ` [PATCH v3 05/17] bnxt: " Greg Kroah-Hartman
2019-08-10 10:17 ` [PATCH v3 06/17] cxgb4: " Greg Kroah-Hartman
2019-08-10 10:17 ` [PATCH v3 07/17] hns3: " Greg Kroah-Hartman
2019-08-10 10:17 ` [PATCH v3 08/17] nfp: " Greg Kroah-Hartman
2019-08-10 10:17 ` [PATCH v3 09/17] stmmac: " Greg Kroah-Hartman
2019-08-10 10:17 ` [PATCH v3 10/17] dpaa2: " Greg Kroah-Hartman
2019-08-10 10:17 ` [PATCH v3 11/17] qca: " Greg Kroah-Hartman
2019-08-13  9:21   ` Stefan Wahren
2019-08-10 10:17 ` [PATCH v3 12/17] skge: " Greg Kroah-Hartman
2019-08-10 10:17 ` Greg Kroah-Hartman [this message]
2019-08-12 17:55   ` [PATCH v3 13/17] mvpp2: " Nick Desaulniers
2019-08-12 19:01     ` Greg Kroah-Hartman
2019-08-12 19:44       ` Nick Desaulniers
2019-08-12 19:51         ` Greg Kroah-Hartman
2019-08-10 10:17 ` [PATCH v3 14/17] fm10k: " Greg Kroah-Hartman
2019-08-10 10:17   ` [Intel-wired-lan] " Greg Kroah-Hartman
2019-08-12 15:46   ` Jeff Kirsher
2019-08-12 15:46     ` [Intel-wired-lan] " Jeff Kirsher
2019-08-10 10:17 ` [PATCH v3 15/17] i40e: " Greg Kroah-Hartman
2019-08-10 10:17   ` [Intel-wired-lan] " Greg Kroah-Hartman
2019-08-12 15:48   ` Jeff Kirsher
2019-08-12 15:48     ` [Intel-wired-lan] " Jeff Kirsher
2019-08-10 10:17 ` [PATCH v3 16/17] ixgbe: " Greg Kroah-Hartman
2019-08-10 10:17   ` [Intel-wired-lan] " Greg Kroah-Hartman
2019-08-12 15:49   ` Jeff Kirsher
2019-08-12 15:49     ` [Intel-wired-lan] " Jeff Kirsher
2019-08-10 10:17 ` [PATCH v3 17/17] ieee802154: " Greg Kroah-Hartman
2019-08-10 22:26 ` [PATCH v3 00/17] Networking driver debugfs cleanups David Miller

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=20190810101732.26612-14-gregkh@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=maxime.chevallier@bootlin.com \
    --cc=ndesaulniers@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhuck@google.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 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.