random: reuse rand_initialize
authorMatt Mackall <mpm@selenic.com>
Tue, 29 Apr 2008 08:02:58 +0000 (01:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 Apr 2008 15:06:24 +0000 (08:06 -0700)
Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/random.c

index 964d78d31578d3e1cac999ef98976150a888d2ac..a2329a11e1393c9aa17ed85b201d2b677ae79dd0 100644 (file)
@@ -899,7 +899,7 @@ static void init_std_data(struct entropy_store *r)
                          sizeof(*(utsname()))/4);
 }
 
-static int __init rand_initialize(void)
+static int rand_initialize(void)
 {
        init_std_data(&input_pool);
        init_std_data(&blocking_pool);
@@ -1101,9 +1101,7 @@ static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
                /* Clear the entropy pool counters. */
                if (!capable(CAP_SYS_ADMIN))
                        return -EPERM;
-               init_std_data(&input_pool);
-               init_std_data(&blocking_pool);
-               init_std_data(&nonblocking_pool);
+               rand_initialize();
                return 0;
        default:
                return -EINVAL;