netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harvey Harrison <harvey.harrison@gmail.com>
To: netdev@vger.kernel.org
Subject: [PATCH] via-rhine: trivial sparse annotation in vlan_tci helper
Date: Mon, 28 Mar 2011 20:08:59 -0700	[thread overview]
Message-ID: <1301368139-2489-1-git-send-email-harvey.harrison@gmail.com> (raw)

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


             reply	other threads:[~2011-03-29  3:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29  3:08 Harvey Harrison [this message]
2011-03-31  4:43 ` [PATCH] via-rhine: trivial sparse annotation in vlan_tci helper David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1301368139-2489-1-git-send-email-harvey.harrison@gmail.com \
    --to=harvey.harrison@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).