net: ethernet: sun: remove redundant variables adv and lpa and mii_reads
authorColin Ian King <colin.king@canonical.com>
Thu, 5 Jul 2018 11:05:25 +0000 (12:05 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Jul 2018 11:07:40 +0000 (20:07 +0900)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sun/niu.c

index 88c12474a0c38cc10f539d7eff0b81a0cc9a4d7a..9319d84bf49f07e9a9cf8514783dacb32b78fee7 100644 (file)
@@ -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;