[PATCH 30/47] headers: Add get_unaligned_be24

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The get_unaligned_be24 function was added with kernel 5.7 to the general
header files and is now used by rtl8723bs.

Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
---
 backport/backport-include/asm/unaligned.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 backport/backport-include/asm/unaligned.h

diff --git a/backport/backport-include/asm/unaligned.h b/backport/backport-include/asm/unaligned.h
new file mode 100644
index 00000000..4e2a6a41
--- /dev/null
+++ b/backport/backport-include/asm/unaligned.h
@@ -0,0 +1,17 @@
+#ifndef __BACKPORT_ASM_GENERIC_UNALIGNED_H
+#define __BACKPORT_ASM_GENERIC_UNALIGNED_H
+#include_next <asm/unaligned.h>
+
+#if LINUX_VERSION_IS_LESS(5,7,0)
+static inline u32 __get_unaligned_be24(const u8 *p)
+{
+	return p[0] << 16 | p[1] << 8 | p[2];
+}
+
+static inline u32 get_unaligned_be24(const void *p)
+{
+	return __get_unaligned_be24(p);
+}
+#endif /* < 5.7 */
+
+#endif /* __BACKPORT_ASM_GENERIC_UNALIGNED_H */
-- 
2.30.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux