netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ASIX: Simplify condition in rx_fixup()
@ 2011-07-27  2:44 Marek Vasut
  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 ` [PATCH 1/2] ASIX: Simplify condition in rx_fixup() David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Marek Vasut @ 2011-07-27  2:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev, linux-usb, gregkh, Marek Vasut

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

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

end of thread, other threads:[~2011-07-28 16:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-27  2:44 [PATCH 1/2] ASIX: Simplify condition in rx_fixup() Marek Vasut
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

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).