* [PATCH][V2] net: ethernet: sun: remove redundant variables adv and lpa and mii_reads
@ 2018-07-05 11:05 Colin King
2018-07-05 11:08 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-07-05 11:05 UTC (permalink / raw)
To: David S . Miller, netdev; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Variables adv and lpa are being assigned but are never used hence they
are redundant and can be removed. Also remove the unncessary mii_reads
too.
Cleans up clang warnings:
warning: variable 'lpa' set but not used [-Wunused-but-set-variable]
warning: variable 'adv' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
V2: remove mii_reads as suggessted by Dan Carpenter and David Miller
---
drivers/net/ethernet/sun/niu.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index 88c12474a0c3..9319d84bf49f 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -1225,25 +1225,9 @@ static int link_status_1g_rgmii(struct niu *np, int *link_up_p)
bmsr = err;
if (bmsr & BMSR_LSTATUS) {
- u16 adv, lpa;
-
- err = mii_read(np, np->phy_addr, MII_ADVERTISE);
- if (err < 0)
- goto out;
- adv = err;
-
- err = mii_read(np, np->phy_addr, MII_LPA);
- if (err < 0)
- goto out;
- lpa = err;
-
- err = mii_read(np, np->phy_addr, MII_ESTATUS);
- if (err < 0)
- goto out;
link_up = 1;
current_speed = SPEED_1000;
current_duplex = DUPLEX_FULL;
-
}
lp->active_speed = current_speed;
lp->active_duplex = current_duplex;
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH][V2] net: ethernet: sun: remove redundant variables adv and lpa and mii_reads
2018-07-05 11:05 [PATCH][V2] net: ethernet: sun: remove redundant variables adv and lpa and mii_reads Colin King
@ 2018-07-05 11:08 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-07-05 11:08 UTC (permalink / raw)
To: colin.king; +Cc: netdev, kernel-janitors, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Thu, 5 Jul 2018 12:05:25 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> Variables adv and lpa are being assigned but are never used hence they
> are redundant and can be removed. Also remove the unncessary mii_reads
> too.
>
> Cleans up clang warnings:
> warning: variable 'lpa' set but not used [-Wunused-but-set-variable]
> warning: variable 'adv' set but not used [-Wunused-but-set-variable]
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>
> V2: remove mii_reads as suggessted by Dan Carpenter and David Miller
Applied, thanks Colin.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-05 11:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-05 11:05 [PATCH][V2] net: ethernet: sun: remove redundant variables adv and lpa and mii_reads Colin King
2018-07-05 11:08 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox