Skip to contentSkip to conversation

smsc9420: fix big endian rx checksum offload

PATCH In review Steve Glendinning 2 participants 2 messages Mar 19, 2009 – Mar 20, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smsc9420: fix big endian rx checksum offload

The cpu_to_le16 here looks suspicious to me, I don't think we need it because put_unaligned_le16 also does this.

I don't currently have any big endian hardware with a PCI bus available to test on, so I haven't been able to verify this.

---
 drivers/net/smsc9420.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/smsc9420.c +1 -1
index 17560db..5959ae8 100644
@@ -807,7 +807,7 @@ static void smsc9420_rx_handoff(struct smsc9420_pdata *pd, const int index,
 	if (pd->rx_csum) {
 		u16 hw_csum = get_unaligned_le16(skb_tail_pointer(skb) +
 			NET_IP_ALIGN + packet_length + 4);
-		put_unaligned_le16(cpu_to_le16(hw_csum), &skb->csum);
+		put_unaligned_le16(hw_csum, &skb->csum);
 		skb->ip_summed = CHECKSUM_COMPLETE;
 	}
 
Signature · 1 line
1.6.0.6
maintainer
#1 lore raw

From: Steve Glendinning <[email protected]>
Date: Thu, 19 Mar 2009 11:12:32 +0000

Quoted 7 lines

The cpu_to_le16 here looks suspicious to me, I don't think we need it because put_unaligned_le16 also does this.

I don't currently have any big endian hardware with a PCI bus available to test on, so I haven't been able to verify this.

Looks good, applied.

skb->csum is never unaligned so you probably want to also convert this to use one of the aligned endianness store interfaces.