]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: macb: remove unnecessary code
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Thu, 3 Jan 2019 14:59:35 +0000 (14:59 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Jan 2019 20:59:09 +0000 (12:59 -0800)
Commit af5d7e7c9a45 ("net: macb: add support for padding and fcs
computation") introduced a bug fixed by commit 95a0db5dc3e3 ("net:
ethernet: cadence: fix socket buffer corruption problem"). Code removed
in this patch is not reachable at all so remove it.

Fixes: af5d7e7c9a45 ("net: macb: add support for padding and fcs computation")
Cc: Tristram Ha <Tristram.Ha@microchip.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb_main.c

index b126926ef7f57a0ad2f4a379c8d3a16e7c0f1051..66cc7927061acd94cb75c9e6fd7cc96793bfec3b 100644 (file)
@@ -1738,12 +1738,8 @@ static int macb_pad_and_fcs(struct sk_buff **skb, struct net_device *ndev)
                *skb = nskb;
        }
 
-       if (padlen) {
-               if (padlen >= ETH_FCS_LEN)
-                       skb_put_zero(*skb, padlen - ETH_FCS_LEN);
-               else
-                       skb_trim(*skb, ETH_FCS_LEN - padlen);
-       }
+       if (padlen > ETH_FCS_LEN)
+               skb_put_zero(*skb, padlen - ETH_FCS_LEN);
 
 add_fcs:
        /* set FCS to packet */