All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] backports: random: add prandom_bytes macro for pre-3.8 kernels
@ 2013-12-22 11:57 Arend van Spriel
  2013-12-22 12:28 ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Arend van Spriel @ 2013-12-22 11:57 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports, Arend van Spriel

Map prandom_bytes() calls to get_random_bytes() for kernels before
3.8 kernel. This patch is needed by mac80211 rate control code
since following:

commit f7d8ad81ca8c447124821e58f876d1aff996c85f
Author: Karl Beldan <karl.beldan@rivierawaves.com>
Date:   Wed Nov 13 10:54:19 2013 +0100

    mac80211: minstrels: spare numerous useless calls to get_random_bytes

Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 backport/backport-include/linux/random.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/backport/backport-include/linux/random.h b/backport/backport-include/linux/random.h
index 812ce7f..3adde28 100644
--- a/backport/backport-include/linux/random.h
+++ b/backport/backport-include/linux/random.h
@@ -8,6 +8,8 @@
 #define prandom_seed(_seed)		srandom32(_seed)
 #define prandom_u32()			random32()
 #define prandom_u32_state(_state)	prandom32(_state)
+/* use get_random_bytes() for lack of prandom_bytes() */
+#define prandom_bytes(a, b)		get_random_bytes(a, b)
 #endif
 
 #endif /* __BACKPORT_RANDOM_H */
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-12-22 17:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-22 11:57 [PATCH] backports: random: add prandom_bytes macro for pre-3.8 kernels Arend van Spriel
2013-12-22 12:28 ` Johannes Berg
2013-12-22 17:15   ` Hauke Mehrtens
2013-12-22 17:27     ` Arend van Spriel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.