X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Frandom32.c;h=ca87d86992bdb7bfd6bb30d4dbe6dcefe2bab7b9;hb=1c47cd638e8302bc38be1f6d81067950e038ebd3;hp=ec7f81d3fb188bc7923837d6d622734be5f54e11;hpb=15a4cb9c25df05a5d4844e80a1aea83d66165868;p=linux-2.6-omap-h63xx.git diff --git a/lib/random32.c b/lib/random32.c index ec7f81d3fb1..ca87d86992b 100644 --- a/lib/random32.c +++ b/lib/random32.c @@ -97,13 +97,18 @@ EXPORT_SYMBOL(random32); * @seed: seed value * * Add some additional seeding to the random32() pool. - * Note: this pool is per cpu so it only affects current CPU. */ void srandom32(u32 entropy) { - struct rnd_state *state = &get_cpu_var(net_rand_state); - __set_random32(state, state->s1 ^ entropy); - put_cpu_var(state); + int i; + /* + * No locking on the CPUs, but then somewhat random results are, well, + * expected. + */ + for_each_possible_cpu (i) { + struct rnd_state *state = &per_cpu(net_rand_state, i); + __set_random32(state, state->s1 ^ entropy); + } } EXPORT_SYMBOL(srandom32);