git: 2e818fbcfc03 - main - LinuxKPI: add get_unaligned_le16()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Mon, 14 Feb 2022 00:10:45 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=2e818fbcfc03f9416593d5fe5bc860c1829f5366

commit 2e818fbcfc03f9416593d5fe5bc860c1829f5366
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-14 00:09:57 +0000

    LinuxKPI: add get_unaligned_le16()
    
    Add get_unaligned_le16() to asm/unaligned.h needed by a driver.
    
    MFC after:      3 days
    Reviewed by:    hselasky
    Differential Revision: https://reviews.freebsd.org/D34224
---
 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)
 {