lkml.org 
[lkml]   [2014]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 3/7] lib/random32.c: Replace an #ifdef with a stub prandom_state_selftest()
The preferred Linux style for optional features is to define
no-op stub functions rather than wrap each call site in #ifdef.

Signed-off-by: George Spelvin <linux@horizon.com>
---
lib/random32.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/random32.c b/lib/random32.c
index 2e7c15c0..e8f3557b 100644
--- a/lib/random32.c
+++ b/lib/random32.c
@@ -40,6 +40,8 @@

#ifdef CONFIG_RANDOM32_SELFTEST
static void __init prandom_state_selftest(void);
+#else
+#define prandom_state_selftest() (void)0
#endif

static DEFINE_PER_CPU(struct rnd_state, net_rand_state);
@@ -188,9 +190,7 @@ static int __init prandom_init(void)
{
int i;

-#ifdef CONFIG_RANDOM32_SELFTEST
prandom_state_selftest();
-#endif

for_each_possible_cpu(i) {
struct rnd_state *state = &per_cpu(net_rand_state,i);
--
2.0.0


\
 
 \ /
  Last update: 2014-06-07 11:01    [W:0.129 / U:1.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site