aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>2010-05-24 17:33:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 11:07:06 -0400
commit4762bbc1a3a1f22095278b74dd1b8cee04858641 (patch)
treed80314902f759a2ee1f6bb25384956021c4b2d04 /lib
parent836e2af92503f1642dbc3c3281ec68ec1dd39d2e (diff)
crc32: use __BYTE_ORDER macro for endian detection.
Since crc32.c contains a nifty test program that can be executed in user space, make sure endian detection works reliably in user space too. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/crc32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/crc32.c b/lib/crc32.c
index 4855995fcde..3087ed899ee 100644
--- a/lib/crc32.c
+++ b/lib/crc32.c
@@ -50,7 +50,7 @@ MODULE_LICENSE("GPL");
50static inline u32 50static inline u32
51crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256]) 51crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256])
52{ 52{
53# ifdef __LITTLE_ENDIAN 53# if __BYTE_ORDER == __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] ^ \