From 8223cd0cc94c68502c997aa6958b4a768dadb5d8 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 16 Jul 2024 17:02:36 -0400 Subject: [PATCH] fix: copy_struct_from_user() for non-LTS branches < v4.19 The 'linux/bits.h' was backported to LTS branches but is not available on non-LTS before v4.19. Use 'asm/byteorder.h' instead to get the __LITTLE_ENDIAN define which is available on all kernel versions we support. Change-Id: Icfe733ab944616b3bd6d0023ad0869eefb830b34 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- include/wrapper/bitops.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/wrapper/bitops.h b/include/wrapper/bitops.h index 01f63262..2693cd1d 100644 --- a/include/wrapper/bitops.h +++ b/include/wrapper/bitops.h @@ -5,11 +5,12 @@ #define _LTTNG_WRAPPER_BITOPS_H #include -#include #include #if LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(5,4,0) +#include + /* Set bits in the first 'n' bytes when loaded from memory */ # ifdef __LITTLE_ENDIAN # define lttng_aligned_byte_mask(n) ((1UL << 8*(n))-1) -- 2.34.1