Skip to content

Commit ba3e184

Browse files
claudiubezneadavem330
authored andcommitted
net: macb: remove unnecessary code
Commit 653e92a ("net: macb: add support for padding and fcs computation") introduced a bug fixed by commit 899ecae ("net: ethernet: cadence: fix socket buffer corruption problem"). Code removed in this patch is not reachable at all so remove it. Fixes: 653e92a ("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>
1 parent a09b42b commit ba3e184

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎drivers/net/ethernet/cadence/macb_main.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,12 +1738,8 @@ static int macb_pad_and_fcs(struct sk_buff **skb, struct net_device *ndev)
17381738
*skb = nskb;
17391739
}
17401740

1741-
if (padlen) {
1742-
if (padlen >= ETH_FCS_LEN)
1743-
skb_put_zero(*skb, padlen - ETH_FCS_LEN);
1744-
else
1745-
skb_trim(*skb, ETH_FCS_LEN - padlen);
1746-
}
1741+
if (padlen > ETH_FCS_LEN)
1742+
skb_put_zero(*skb, padlen - ETH_FCS_LEN);
17471743

17481744
add_fcs:
17491745
/* set FCS to packet */

0 commit comments

Comments
 (0)