Skip to contentSkip to conversation

ksz884x: fix Endian

PATCH Applied [email protected] 2 participants 2 messages Jul 10, 2012 – Jul 11, 2012

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

PATCH v2 1/1 ksz884x: fix Endian

From: Li RongQing <[email protected]>

ETH_P_IP is host Endian, skb->protocol is big Endian, when compare them, Using htons on skb->protocol is wrong.

And fix two code style issues: indentation and remove unnecessary parentheses.

CC Tristram Ha <[email protected]>
CC Ben Hutchings <[email protected]>
CC Joe Perches <[email protected]>
---
 drivers/net/ethernet/micrel/ksz884x.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/micrel/ksz884x.c +2 -2
index eaf9ff0..0fbe2e2 100644
@@ -4881,8 +4881,8 @@ static netdev_tx_t netdev_tx(struct sk_buff *skb, struct net_device *dev)
 	left = hw_alloc_pkt(hw, skb->len, num);
 	if (left) {
 		if (left < num ||
-				((CHECKSUM_PARTIAL == skb->ip_summed) &&
-				(ETH_P_IPV6 == htons(skb->protocol)))) {
+		    (CHECKSUM_PARTIAL == skb->ip_summed &&
+		     skb->protocol == htons(ETH_P_IPV6))) {
 			struct sk_buff *org_skb = skb;
 
 			skb = netdev_alloc_skb(dev, org_skb->len);
Signature · 1 line
1.7.1
maintainer Applied
#1 lore raw

From: [email protected]
Date: Tue, 10 Jul 2012 14:56:06 +0800

Quoted 5 lines

From: Li RongQing <[email protected]>

ETH_P_IP is host Endian, skb->protocol is big Endian, when compare them, Using htons on skb->protocol is wrong.

Quoted 7 lines

And fix two code style issues: indentation and remove unnecessary parentheses.

CC Tristram Ha <[email protected]>
CC Ben Hutchings <[email protected]>
CC Joe Perches <[email protected]>

Applied.