Re: eepro100 driver update

From: David S. Miller (davem@redhat.com)
Date: Mon Mar 27 2000 - 06:34:22 EST


   Date: Mon, 27 Mar 2000 19:00:37 +0800
   From: Andrey Savochkin <saw@saw.sw.com.sg>

   +#if defined(__LITTLE_ENDIAN)
   +#define clear_suspend(cmd) ((__u16 *)&(cmd)->cmd_status)[1] &= ~0x4000
   +#elif defined(__BIG_ENDIAN)
   +#define clear_suspend(cmd) ((__u16 *)&(cmd)->cmd_status)[0] &= ~0x4000

The big endian version is wrong, think about it, the correct version
is:

#if defined(__LITTLE_ENDIAN)
#define clear_suspend(cmd) ((__u16 *)&(cmd)->cmd_status)[1] &= ~0x4000
#elif defined(__BIG_ENDIAN)
#define clear_suspend(cmd) ((__u16 *)&(cmd)->cmd_status)[1] &= ~0x0040
#else

It seems very non-intuitive, but if you do all the byte swaps in
your head, it makes complete sense, and what's more this is tested
:-)

I've already sent this fix to Alan for 2.2.15pre, let's not let
this bug slip into 2.3.99pre as well.

Later,
David S. Miller
davem@redhat.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 21:00:19 EST