From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
To: "David S. Miller" <davem@davemloft.net>,
Jesper Dangaard Brouer <brouer@redhat.com>,
Eric Dumazet <edumazet@google.com>
Cc: netdev@vager.kernel.org, linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Subject: [PATCH] net: core: remove unnecessary code
Date: Wed, 3 May 2017 12:17:30 -0500 [thread overview]
Message-ID: <20170503171730.GA14179@embeddedgus> (raw)
The name of an array used by itself will always return the array's address.
So this test will always evaluate as true.
Addresses-Coverity-ID: 115325
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
net/core/netpoll.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 9424673..27ce3b1 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -657,13 +657,13 @@ int netpoll_setup(struct netpoll *np)
{
struct net_device *ndev = NULL;
struct in_device *in_dev;
+ struct net *net;
int err;
rtnl_lock();
- if (np->dev_name) {
- struct net *net = current->nsproxy->net_ns;
- ndev = __dev_get_by_name(net, np->dev_name);
- }
+ net = current->nsproxy->net_ns;
+ ndev = __dev_get_by_name(net, np->dev_name);
+
if (!ndev) {
np_err(np, "%s doesn't exist, aborting\n", np->dev_name);
err = -ENODEV;
--
2.5.0
reply other threads:[~2017-05-03 17:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20170503171730.GA14179@embeddedgus \
--to=garsilva@embeddedor.com \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vager.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).