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>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	"David S. Miller" <davem@davemloft.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Edwin Peer <edwin.peer@netronome.com>,
	Yangtao Li <tiny.windzz@gmail.com>,
	Simon Horman <simon.horman@netronome.com>,
	oss-drivers@netronome.com
Subject: [PATCH v2 08/17] nfp: no need to check return value of debugfs_create functions
Date: Fri,  9 Aug 2019 14:30:59 +0200	[thread overview]
Message-ID: <20190809123108.27065-9-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: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jesper Dangaard Brouer <hawk@kernel.org>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Edwin Peer <edwin.peer@netronome.com>
Cc: Yangtao Li <tiny.windzz@gmail.com>
Cc: Simon Horman <simon.horman@netronome.com>
Cc: oss-drivers@netronome.com
Cc: netdev@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 .../ethernet/netronome/nfp/nfp_net_debugfs.c    | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_debugfs.c b/drivers/net/ethernet/netronome/nfp/nfp_net_debugfs.c
index ab7f2498e1c4..553c708694e8 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_debugfs.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_debugfs.c
@@ -159,19 +159,13 @@ void nfp_net_debugfs_vnic_add(struct nfp_net *nn, struct dentry *ddir)
 	else
 		strcpy(name, "ctrl-vnic");
 	nn->debugfs_dir = debugfs_create_dir(name, ddir);
-	if (IS_ERR_OR_NULL(nn->debugfs_dir))
-		return;
 
 	/* Create queue debugging sub-tree */
 	queues = debugfs_create_dir("queue", nn->debugfs_dir);
-	if (IS_ERR_OR_NULL(queues))
-		return;
 
 	rx = debugfs_create_dir("rx", queues);
 	tx = debugfs_create_dir("tx", queues);
 	xdp = debugfs_create_dir("xdp", queues);
-	if (IS_ERR_OR_NULL(rx) || IS_ERR_OR_NULL(tx) || IS_ERR_OR_NULL(xdp))
-		return;
 
 	for (i = 0; i < min(nn->max_rx_rings, nn->max_r_vecs); i++) {
 		sprintf(name, "%d", i);
@@ -190,16 +184,7 @@ void nfp_net_debugfs_vnic_add(struct nfp_net *nn, struct dentry *ddir)
 
 struct dentry *nfp_net_debugfs_device_add(struct pci_dev *pdev)
 {
-	struct dentry *dev_dir;
-
-	if (IS_ERR_OR_NULL(nfp_dir))
-		return NULL;
-
-	dev_dir = debugfs_create_dir(pci_name(pdev), nfp_dir);
-	if (IS_ERR_OR_NULL(dev_dir))
-		return NULL;
-
-	return dev_dir;
+	return debugfs_create_dir(pci_name(pdev), nfp_dir);
 }
 
 void nfp_net_debugfs_dir_clean(struct dentry **dir)
-- 
2.22.0


  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 ` Greg Kroah-Hartman [this message]
2019-08-09 17:10   ` [PATCH v2 08/17] nfp: " 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 ` [Intel-wired-lan] [PATCH v2 16/17] ixgbe: " Greg Kroah-Hartman
2019-08-09 12:31   ` 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-9-gregkh@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edwin.peer@netronome.com \
    --cc=hawk@kernel.org \
    --cc=jakub.kicinski@netronome.com \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=simon.horman@netronome.com \
    --cc=tiny.windzz@gmail.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.