Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "endian: #define __BYTE_ORDER"

This reverts commit b3b77c8caef1750ebeea1054e39e358550ea9f55, which was
also totally broken (see commit 0d2daf5cc858 that reverted the crc32
version of it). As reported by Stephen Rothwell, it causes problems on
big-endian machines:

> In file included from fs/jfs/jfs_types.h:33,
> from fs/jfs/jfs_incore.h:26,
> from fs/jfs/file.c:22:
> fs/jfs/endian24.h:36:101: warning: "__LITTLE_ENDIAN" is not defined

The kernel has never had that crazy "__BYTE_ORDER == __LITTLE_ENDIAN"
model. It's not how we do things, and it isn't how we _should_ do
things. So don't go there.

Requested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+31 -8
+5
arch/alpha/math-emu/sfp-util.h
··· 28 28 #define UDIV_NEEDS_NORMALIZATION 1 29 29 30 30 #define abort() goto bad_insn 31 + 32 + #ifndef __LITTLE_ENDIAN 33 + #define __LITTLE_ENDIAN -1 34 + #endif 35 + #define __BYTE_ORDER __LITTLE_ENDIAN
+6
arch/powerpc/include/asm/sfp-machine.h
··· 353 353 #define abort() \ 354 354 return 0 355 355 356 + #ifdef __BIG_ENDIAN 357 + #define __BYTE_ORDER __BIG_ENDIAN 358 + #else 359 + #define __BYTE_ORDER __LITTLE_ENDIAN 360 + #endif 361 + 356 362 /* Exception flags. */ 357 363 #define EFLAG_INVALID (1 << (31 - 2)) 358 364 #define EFLAG_OVERFLOW (1 << (31 - 3))
+2
arch/s390/include/asm/sfp-util.h
··· 73 73 #define UDIV_NEEDS_NORMALIZATION 0 74 74 75 75 #define abort() return 0 76 + 77 + #define __BYTE_ORDER __BIG_ENDIAN
+4
arch/sh/math-emu/sfp-util.h
··· 66 66 } while (0) 67 67 68 68 #define abort() return 0 69 + 70 + #define __BYTE_ORDER __LITTLE_ENDIAN 71 + 72 +
+6
arch/sparc/math-emu/sfp-util_32.h
··· 107 107 108 108 #define abort() \ 109 109 return 0 110 + 111 + #ifdef __BIG_ENDIAN 112 + #define __BYTE_ORDER __BIG_ENDIAN 113 + #else 114 + #define __BYTE_ORDER __LITTLE_ENDIAN 115 + #endif
+6
arch/sparc/math-emu/sfp-util_64.h
··· 112 112 113 113 #define abort() \ 114 114 return 0 115 + 116 + #ifdef __BIG_ENDIAN 117 + #define __BYTE_ORDER __BIG_ENDIAN 118 + #else 119 + #define __BYTE_ORDER __LITTLE_ENDIAN 120 + #endif
+2 -2
arch/x86/boot/compressed/relocs.c
··· 195 195 196 196 197 197 198 - #if __BYTE_ORDER == __LITTLE_ENDIAN 198 + #if BYTE_ORDER == LITTLE_ENDIAN 199 199 #define le16_to_cpu(val) (val) 200 200 #define le32_to_cpu(val) (val) 201 201 #endif 202 - #if __BYTE_ORDER == __BIG_ENDIAN 202 + #if BYTE_ORDER == BIG_ENDIAN 203 203 #define le16_to_cpu(val) bswap_16(val) 204 204 #define le32_to_cpu(val) bswap_32(val) 205 205 #endif
-3
include/linux/byteorder/big_endian.h
··· 7 7 #ifndef __BIG_ENDIAN_BITFIELD 8 8 #define __BIG_ENDIAN_BITFIELD 9 9 #endif 10 - #ifndef __BYTE_ORDER 11 - #define __BYTE_ORDER __BIG_ENDIAN 12 - #endif 13 10 14 11 #include <linux/types.h> 15 12 #include <linux/swab.h>
-3
include/linux/byteorder/little_endian.h
··· 7 7 #ifndef __LITTLE_ENDIAN_BITFIELD 8 8 #define __LITTLE_ENDIAN_BITFIELD 9 9 #endif 10 - #ifndef __BYTE_ORDER 11 - #define __BYTE_ORDER __LITTLE_ENDIAN 12 - #endif 13 10 14 11 #include <linux/types.h> 15 12 #include <linux/swab.h>