linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: macb: remove unnecessary code
@ 2019-01-03 14:59 Claudiu.Beznea
  2019-01-04 21:00 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Claudiu.Beznea @ 2019-01-03 14:59 UTC (permalink / raw)
  To: Nicolas.Ferre, davem; +Cc: netdev, linux-kernel, Claudiu.Beznea, Tristram.Ha

From: Claudiu Beznea <claudiu.beznea@microchip.com>

Commit 653e92a9175e ("net: macb: add support for padding and fcs
computation") introduced a bug fixed by commit 899ecaedd155 ("net:
ethernet: cadence: fix socket buffer corruption problem"). Code removed
in this patch is not reachable at all so remove it.

Fixes: 653e92a9175e ("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>
---
 drivers/net/ethernet/cadence/macb_main.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index b126926ef7f5..66cc7927061a 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -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 */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: macb: remove unnecessary code
  2019-01-03 14:59 [PATCH] net: macb: remove unnecessary code Claudiu.Beznea
@ 2019-01-04 21:00 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-01-04 21:00 UTC (permalink / raw)
  To: Claudiu.Beznea; +Cc: Nicolas.Ferre, netdev, linux-kernel, Tristram.Ha

From: <Claudiu.Beznea@microchip.com>
Date: Thu, 3 Jan 2019 14:59:35 +0000

> From: Claudiu Beznea <claudiu.beznea@microchip.com>
> 
> Commit 653e92a9175e ("net: macb: add support for padding and fcs
> computation") introduced a bug fixed by commit 899ecaedd155 ("net:
> ethernet: cadence: fix socket buffer corruption problem"). Code removed
> in this patch is not reachable at all so remove it.
> 
> Fixes: 653e92a9175e ("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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-04 21:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-03 14:59 [PATCH] net: macb: remove unnecessary code Claudiu.Beznea
2019-01-04 21:00 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).