Messages in this thread | | | Date | Thu, 24 Jun 2004 15:06:27 +0200 | From | Andries Brouwer <> | Subject | Re: [PATCH 2.6.7-mm1] MBR centralization |
| |
On Thu, Jun 24, 2004 at 08:38:52AM +0100, Anton Altaparmakov wrote:
> While I am at it, the above macro is even further optimized by moving the > endianness conversion to the constant so it is applied at compile time > rather than run time like so: > > #define MSDOS_MBR(p) ((*(u16*)(p)) == __constant_cpu_to_le16(0xaa55))
I never understand why people want to do such things. Cast a character pointer to u16*, possibly do a byteswap, etc. What one wants is just
p[0] == 0x55 && p[1] == 0xaa - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |