netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vince Bridgers <vbridgers2013@gmail.com>
To: netdev@vger.kernel.org, davem@davemloft.net, peppe.cavallaro@st.com
Cc: vbridgers2013@gmail.com, vbridger@altera.com
Subject: [PATCH net v2 3/3] net: stmmac: Remove unneeded I/O read caught by cppcheck
Date: Sun, 29 Jun 2014 20:34:53 -0500	[thread overview]
Message-ID: <1404092093-18630-4-git-send-email-vbridgers2013@gmail.com> (raw)
In-Reply-To: <1404092093-18630-1-git-send-email-vbridgers2013@gmail.com>

Cppcheck found a case where a local variable was being assigned a value,
but not used. There seems to be no reason to read this register before
assigning a new value, so addressing thie issue.

cppcheck --force --enable=all --inline-suppr . shows ...

Variable 'value' is reassigned a value before the old one has been used.

Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
---
V2: No change, new trivial patch in this series
---
 .../net/ethernet/stmicro/stmmac/dwmac1000_core.c   |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
index b3e148e..9d37483 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
@@ -320,11 +320,8 @@ static void dwmac1000_set_eee_timer(void __iomem *ioaddr, int ls, int tw)
 
 static void dwmac1000_ctrl_ane(void __iomem *ioaddr, bool restart)
 {
-	u32 value;
-
-	value = readl(ioaddr + GMAC_AN_CTRL);
 	/* auto negotiation enable and External Loopback enable */
-	value = GMAC_AN_CTRL_ANE | GMAC_AN_CTRL_ELE;
+	u32 value = GMAC_AN_CTRL_ANE | GMAC_AN_CTRL_ELE;
 
 	if (restart)
 		value |= GMAC_AN_CTRL_RAN;
-- 
1.7.9.5

  parent reply	other threads:[~2014-06-30  1:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30  1:34 [PATCH net v2 0/3] net: stmmac: Correct socfpga init/exit and Vince Bridgers
2014-06-30  1:34 ` [PATCH net v2 1/3] net: stmmac: add platform init/exit for Altera's ARM socfpga Vince Bridgers
2014-06-30  1:34 ` [PATCH net v2 2/3] net: stmmac: Correct duplicate if/then/else case found by cppcheck Vince Bridgers
2014-06-30  1:34 ` Vince Bridgers [this message]
2014-07-03  1:38 ` [PATCH net v2 0/3] net: stmmac: Correct socfpga init/exit and 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=1404092093-18630-4-git-send-email-vbridgers2013@gmail.com \
    --to=vbridgers2013@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=vbridger@altera.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;
as well as URLs for NNTP newsgroup(s).