netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org, linux-usb@vger.kernel.org,
	gregkh@suse.de, Marek Vasut <marek.vasut@gmail.com>
Subject: [PATCH 1/2] ASIX: Simplify condition in rx_fixup()
Date: Wed, 27 Jul 2011 04:44:46 +0200	[thread overview]
Message-ID: <1311734687-23551-1-git-send-email-marek.vasut@gmail.com> (raw)

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 drivers/net/usb/asix.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 5250288..d5b62a4 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -314,10 +314,9 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
 	skb_pull(skb, 4);
 
 	while (skb->len > 0) {
-		if ((short)(header & 0x0000ffff) !=
-		    ~((short)((header & 0xffff0000) >> 16))) {
+		if ((header & 0xffff) != ((~header >> 16) & 0xffff))
 			netdev_err(dev->net, "asix_rx_fixup() Bad Header Length\n");
-		}
+
 		/* get the packet length */
 		size = (u16) (header & 0x0000ffff);
 
-- 
1.7.5.3

             reply	other threads:[~2011-07-27  2:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-27  2:44 Marek Vasut [this message]
2011-07-27  2:44 ` [PATCH 2/2] ASIX: Use only 11 bits of header for data size Marek Vasut
2011-07-28  5:40   ` David Miller
     [not found]     ` <20110727.224029.619127041796367339.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2011-07-28  6:06       ` Marek Vasut
2011-07-28 15:18         ` Greg KH
     [not found]           ` <20110728151806.GB22202-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2011-07-28 16:17             ` Marek Vasut
2011-07-28  5:40 ` [PATCH 1/2] ASIX: Simplify condition in rx_fixup() 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=1311734687-23551-1-git-send-email-marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --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).