On Fri, 08 Jun 2007 11:40:19 +0800, Zhu Yi wrote: > On Thu, 2007-06-07 at 19:14 -0700, Michael Wu wrote: > > > +#define SET_TSINFO_ACK(i, d) (i.short1 |= (d << 14) & > > 0xC000) > > > + > > Everything that touches short1 looks broken on big endian. > > No. These are safe on all endians as long as you touch short1 with these > macros. Because from the macro mask, you can see no value d is more than > a byte. No. Michael is right and I'm really blind I haven't seen that myself. That's totally broken. You cannot do _any_ bit operation on __le16. Let's assume that a value of short1 is 0x34 0x12 (two bytes as stored in a memory). Now let's look at the result of (short1 & 0xff). On a LE platform that's (0x1234 & 0xff), i.e. 0x34. On a BE platform that's (0x3412 & 0xff), i.e. 0x12. How that could be correct? Jiri -- Jiri Benc SUSE Labs - To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html