netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] via-rhine: trivial sparse annotation in vlan_tci helper
@ 2011-03-29  3:08 Harvey Harrison
  2011-03-31  4:43 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Harvey Harrison @ 2011-03-29  3:08 UTC (permalink / raw)
  To: netdev

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

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 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


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

end of thread, other threads:[~2011-03-31  4:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-29  3:08 [PATCH] via-rhine: trivial sparse annotation in vlan_tci helper Harvey Harrison
2011-03-31  4:43 ` 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).