OSDN Git Service

random: statically compute poolbitshift, poolbytes, poolbits
authorH. Peter Anvin <hpa@linux.intel.com>
Wed, 11 Sep 2013 03:16:17 +0000 (23:16 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 10 Oct 2013 18:32:13 +0000 (14:32 -0400)
commit9ed17b70b409dc48c134a80b5a6df582ba759de2
tree5e1efaa318847e95e46c46d5ea800c50e253c865
parent85a1f77716cf546d9b9c42e2848b5712f51ba1ee
random: statically compute poolbitshift, poolbytes, poolbits

Use a macro to statically compute poolbitshift (will be used in a
subsequent patch), poolbytes, and poolbits.  On virtually all
architectures the cost of a memory load with an offset is the same as
the one of a memory load.

It is still possible for this to generate worse code since the C
compiler doesn't know the fixed relationship between these fields, but
that is somewhat unlikely.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
drivers/char/random.c