Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net-next] net: natsemi: Remove set but not used variable
@ 2020-09-19 2:46 Zheng Yongjun
2020-09-19 21:10 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Zheng Yongjun @ 2020-09-19 2:46 UTC (permalink / raw)
To: davem, kuba, netdev, linux-kernel; +Cc: Zheng Yongjun
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/net/ethernet/natsemi/ns83820.c: In function ns83820_get_link_ksettings:
drivers/net/ethernet/natsemi/ns83820.c:1210:11: warning: variable ‘tanar’ set but not used [-Wunused-but-set-variable]
`tanar` is never used, so remove it.
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
drivers/net/ethernet/natsemi/ns83820.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c
index 8e24c7acf79b..144feb2d2622 100644
--- a/drivers/net/ethernet/natsemi/ns83820.c
+++ b/drivers/net/ethernet/natsemi/ns83820.c
@@ -1207,7 +1207,7 @@ static int ns83820_get_link_ksettings(struct net_device *ndev,
struct ethtool_link_ksettings *cmd)
{
struct ns83820 *dev = PRIV(ndev);
- u32 cfg, tanar, tbicr;
+ u32 cfg, tbicr;
int fullduplex = 0;
u32 supported;
@@ -1226,8 +1226,8 @@ static int ns83820_get_link_ksettings(struct net_device *ndev,
/* read current configuration */
cfg = readl(dev->base + CFG) ^ SPDSTS_POLARITY;
- tanar = readl(dev->base + TANAR);
tbicr = readl(dev->base + TBICR);
+ readl(dev->base + TANAR);
fullduplex = (cfg & CFG_DUPSTS) ? 1 : 0;
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: natsemi: Remove set but not used variable
2020-09-19 2:46 [PATCH net-next] net: natsemi: Remove set but not used variable Zheng Yongjun
@ 2020-09-19 21:10 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-09-19 21:10 UTC (permalink / raw)
To: zhengyongjun3; +Cc: kuba, netdev, linux-kernel
From: Zheng Yongjun <zhengyongjun3@huawei.com>
Date: Sat, 19 Sep 2020 10:46:44 +0800
> @@ -1226,8 +1226,8 @@ static int ns83820_get_link_ksettings(struct net_device *ndev,
>
> /* read current configuration */
> cfg = readl(dev->base + CFG) ^ SPDSTS_POLARITY;
> - tanar = readl(dev->base + TANAR);
> tbicr = readl(dev->base + TBICR);
> + readl(dev->base + TANAR);
>
Please do not change the order of the readl() operations, it might
matter.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-19 21:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-19 2:46 [PATCH net-next] net: natsemi: Remove set but not used variable Zheng Yongjun
2020-09-19 21:10 ` David Miller
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).