diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2010-05-26 02:43:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-26 11:19:23 -0400 |
commit | 0d2daf5cc858bd9305bae187310a1dabaad0a2db (patch) | |
tree | 94c2d457d328ac2f093195ad4de28fecb3ec9d7c /lib/crc32.c | |
parent | cc68e3be7412baaa1ea2a2df9e88770f1753da78 (diff) |
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 <joakim.tjernlund@transmode.se>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/crc32.c')
-rw-r--r-- | lib/crc32.c | 2 |
1 files changed, 1 insertions, 1 deletions
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"); | |||
50 | static inline u32 | 50 | static inline u32 |
51 | crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256]) | 51 | crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256]) |
52 | { | 52 | { |
53 | # if __BYTE_ORDER == __LITTLE_ENDIAN | 53 | # ifdef __LITTLE_ENDIAN |
54 | # define DO_CRC(x) crc = tab[0][(crc ^ (x)) & 255] ^ (crc >> 8) | 54 | # define DO_CRC(x) crc = tab[0][(crc ^ (x)) & 255] ^ (crc >> 8) |
55 | # define DO_CRC4 crc = tab[3][(crc) & 255] ^ \ | 55 | # define DO_CRC4 crc = tab[3][(crc) & 255] ^ \ |
56 | tab[2][(crc >> 8) & 255] ^ \ | 56 | tab[2][(crc >> 8) & 255] ^ \ |