[PATCH] via-rhine: trivial sparse annotation in vlan_tci helper

Subsystems: networking drivers, the rest

STALE5645d

2 messages, 2 authors, 2011-03-31 · open the first message on its own page

[PATCH] via-rhine: trivial sparse annotation in vlan_tci helper

From: Harvey Harrison <hidden>
Date: 2011-03-29 03:20:45

Noticed by sparse:
drivers/net/via-rhine.c:1706:16: warning: cast to restricted __be16

Signed-off-by: Harvey Harrison <redacted>
---
 drivers/net/via-rhine.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index 5e7f069..707f7f8 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -1703,7 +1703,7 @@ static void rhine_tx(struct net_device *dev)
 static inline u16 rhine_get_vlan_tci(struct sk_buff *skb, int data_size)
 {
 	u8 *trailer = (u8 *)skb->data + ((data_size + 3) & ~3) + 2;
-	return ntohs(*(u16 *)trailer);
+	return be16_to_cpup((__be16 *)trailer);
 }
 
 /* Process up to limit frames from receive ring */
-- 
1.7.4

Re: [PATCH] via-rhine: trivial sparse annotation in vlan_tci helper

From: David Miller <davem@davemloft.net>
Date: 2011-03-31 04:44:07

From: Harvey Harrison <redacted>
Date: Mon, 28 Mar 2011 20:08:59 -0700
Noticed by sparse:
drivers/net/via-rhine.c:1706:16: warning: cast to restricted __be16

Signed-off-by: Harvey Harrison <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help