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

Configure Feed

Select the types of activity you want to include in your feed.

samples: seccomp: Use __BYTE_ORDER__

Use the compiler-defined __BYTE_ORDER__ instead of the libc-defined
__BYTE_ORDER for consistency.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211026010831.748682-5-iii@linux.ibm.com

authored by

Ilya Leoshkevich and committed by
Andrii Nakryiko
14e6cac7 06fca841

+4 -4
+4 -4
samples/seccomp/bpf-helper.h
··· 62 62 #define EXPAND(...) __VA_ARGS__ 63 63 64 64 /* Ensure that we load the logically correct offset. */ 65 - #if __BYTE_ORDER == __LITTLE_ENDIAN 65 + #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 66 66 #define LO_ARG(idx) offsetof(struct seccomp_data, args[(idx)]) 67 - #elif __BYTE_ORDER == __BIG_ENDIAN 67 + #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ 68 68 #define LO_ARG(idx) offsetof(struct seccomp_data, args[(idx)]) + sizeof(__u32) 69 69 #else 70 70 #error "Unknown endianness" ··· 85 85 #elif __BITS_PER_LONG == 64 86 86 87 87 /* Ensure that we load the logically correct offset. */ 88 - #if __BYTE_ORDER == __LITTLE_ENDIAN 88 + #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 89 89 #define ENDIAN(_lo, _hi) _lo, _hi 90 90 #define HI_ARG(idx) offsetof(struct seccomp_data, args[(idx)]) + sizeof(__u32) 91 - #elif __BYTE_ORDER == __BIG_ENDIAN 91 + #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ 92 92 #define ENDIAN(_lo, _hi) _hi, _lo 93 93 #define HI_ARG(idx) offsetof(struct seccomp_data, args[(idx)]) 94 94 #endif