git: 3dff0341d910 - stable/13 - LinuxKPI: add get_unaligned_le16()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 20 Feb 2022 18:15:37 UTC
The branch stable/13 has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=3dff0341d9102bd58f6a48568b62222baddd5f4d
commit 3dff0341d9102bd58f6a48568b62222baddd5f4d
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-02-09 11:37:37 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-02-20 16:24:28 +0000
LinuxKPI: add get_unaligned_le16()
Add get_unaligned_le16() to asm/unaligned.h needed by a driver.
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D34224
(cherry picked from commit 2e818fbcfc03f9416593d5fe5bc860c1829f5366)
---
sys/compat/linuxkpi/common/include/asm/unaligned.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sys/compat/linuxkpi/common/include/asm/unaligned.h b/sys/compat/linuxkpi/common/include/asm/unaligned.h
index 9a788c965653..8a001ec38c3d 100644
--- a/sys/compat/linuxkpi/common/include/asm/unaligned.h
+++ b/sys/compat/linuxkpi/common/include/asm/unaligned.h
@@ -36,6 +36,13 @@
#include <linux/types.h>
#include <asm/byteorder.h>
+static __inline uint16_t
+get_unaligned_le16(const void *p)
+{
+
+ return (le16_to_cpup((const __le16 *)p));
+}
+
static __inline uint32_t
get_unaligned_le32(const void *p)
{