[PATCH 28/74] backports: add get_random_u16()

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

 



From: Gregory Greenman <gregory.greenman@xxxxxxxxx>

Signed-off-by: Gregory Greenman <gregory.greenman@xxxxxxxxx>
Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
---
 backport/backport-include/linux/random.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/backport/backport-include/linux/random.h b/backport/backport-include/linux/random.h
index 0a247321785a..89e9ce022505 100644
--- a/backport/backport-include/linux/random.h
+++ b/backport/backport-include/linux/random.h
@@ -3,6 +3,13 @@
 #include_next <linux/random.h>
 #include <linux/version.h>
 
+#if LINUX_VERSION_IS_LESS(6,1,0)
+static inline u16 get_random_u16(void)
+{
+	return get_random_int() & 0xffff;
+}
+#endif
+
 #if LINUX_VERSION_IS_LESS(6,2,0)
 static inline u32 get_random_u32_below(u32 ceil)
 {
-- 
2.45.1





[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