fix: copy_struct_from_user() for non-LTS branches < v4.19
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 16 Jul 2024 21:02:36 +0000 (17:02 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 17 Jul 2024 14:26:12 +0000 (10:26 -0400)
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 <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/wrapper/bitops.h

index 01f632621e0c7ba81e0bd3296aeca836377f16ea..2693cd1d13e74aff72669c37af2ed812198021ba 100644 (file)
@@ -5,11 +5,12 @@
 #define _LTTNG_WRAPPER_BITOPS_H
 
 #include <linux/bitops.h>
-#include <linux/bits.h>
 #include <lttng/kernel-version.h>
 
 #if LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(5,4,0)
 
+#include <asm/byteorder.h>
+
 /* Set bits in the first 'n' bytes when loaded from memory */
 # ifdef __LITTLE_ENDIAN
 #  define lttng_aligned_byte_mask(n) ((1UL << 8*(n))-1)
This page took 0.026103 seconds and 4 git commands to generate.