Skip to content

Commit 0d2daf5

Browse files
akpm00torvalds
authored andcommitted
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 <[email protected]> Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent cc68e3b commit 0d2daf5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/crc32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ MODULE_LICENSE("GPL");
5050
static inline u32
5151
crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256])
5252
{
53-
# if __BYTE_ORDER == __LITTLE_ENDIAN
53+
# ifdef __LITTLE_ENDIAN
5454
# define DO_CRC(x) crc = tab[0][(crc ^ (x)) & 255] ^ (crc >> 8)
5555
# define DO_CRC4 crc = tab[3][(crc) & 255] ^ \
5656
tab[2][(crc >> 8) & 255] ^ \

0 commit comments

Comments
 (0)