[PATCH 30/47] headers: Add get_unaligned_be24

Hauke Mehrtens <[email protected]>
Newsgroups org.kernel.vger.backports
Message-ID <[email protected]>
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 <[email protected]>
---
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.