Skip to content

Commit

Permalink
net: r6040: Use ETH_FCS_LEN
Browse files Browse the repository at this point in the history
Instead of the open coded constant 4.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed May 24, 2021
1 parent 190e6e2 commit 0666690
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/rdc/r6040.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,15 +544,15 @@ static int r6040_rx(struct net_device *dev, int limit)
skb_ptr->dev = priv->dev;

/* Do not count the CRC */
skb_put(skb_ptr, descptr->len - 4);
skb_put(skb_ptr, descptr->len - ETH_FCS_LEN);
dma_unmap_single(&priv->pdev->dev, le32_to_cpu(descptr->buf),
MAX_BUF_SIZE, DMA_FROM_DEVICE);
skb_ptr->protocol = eth_type_trans(skb_ptr, priv->dev);

/* Send to upper layer */
netif_receive_skb(skb_ptr);
dev->stats.rx_packets++;
dev->stats.rx_bytes += descptr->len - 4;
dev->stats.rx_bytes += descptr->len - ETH_FCS_LEN;

/* put new skb into descriptor */
descptr->skb_ptr = new_skb;
Expand Down

0 comments on commit 0666690

Please sign in to comment.