提交 0d2daf5c 编写于 作者: A Andrew Morton 提交者: Linus Torvalds

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: NStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 cc68e3be
......@@ -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] ^ \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册