From: Andrew Morton Date: Wed, 26 May 2010 06:43:03 +0000 (-0700) Subject: revert "crc32: use __BYTE_ORDER macro for endian detection" X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0d2daf5cc858;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git revert "crc32: use __BYTE_ORDER macro for endian detection" It doesn't work on big-endian - those architectures don't define __LITTLE_ENDIAN. Cc: Joakim Tjernlund Reported-by: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/lib/crc32.c b/lib/crc32.c index 3087ed899ee3..4855995fcde9 100644 --- a/lib/crc32.c +++ b/lib/crc32.c @@ -50,7 +50,7 @@ MODULE_LICENSE("GPL"); static inline u32 crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256]) { -# if __BYTE_ORDER == __LITTLE_ENDIAN +# ifdef __LITTLE_ENDIAN # define DO_CRC(x) crc = tab[0][(crc ^ (x)) & 255] ^ (crc >> 8) # define DO_CRC4 crc = tab[3][(crc) & 255] ^ \ tab[2][(crc >> 8) & 255] ^ \