pcnet32: Remove redundant variable prev_link and curr_link
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Sun, 25 Apr 2021 10:35:18 +0000 (18:35 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Apr 2021 19:46:10 +0000 (12:46 -0700)
Variable prev_link and curr_link is being assigned a value from a
calculation however the variable is never read, so this redundant
variable can be removed.

Cleans up the following clang-analyzer warning:

drivers/net/ethernet/amd/pcnet32.c:2857:4: warning: Value stored to
'prev_link' is never read [clang-analyzer-deadcode.DeadStores].

drivers/net/ethernet/amd/pcnet32.c:2856:4: warning: Value stored to
'curr_link' is never read [clang-analyzer-deadcode.DeadStores].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amd/pcnet32.c

index f78daba..aa41250 100644 (file)
@@ -2853,8 +2853,7 @@ static void pcnet32_check_media(struct net_device *dev, int verbose)
                        netif_info(lp, link, dev, "link down\n");
                }
                if (lp->phycount > 1) {
-                       curr_link = pcnet32_check_otherphy(dev);
-                       prev_link = 0;
+                       pcnet32_check_otherphy(dev);
                }
        } else if (verbose || !prev_link) {
                netif_carrier_on(dev);