From: Akinobu Mita Date: Wed, 20 Mar 2013 04:08:44 +0000 (+1100) Subject: uuid: use prandom_bytes() X-Git-Tag: next-20130322~1^2~73 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1cb227dd5f0d2291228a288ae42976b9a2ba3a5a;p=karo-tx-linux.git uuid: use prandom_bytes() Use prandom_bytes() to generate 16 bytes of pseudo-random bytes. Signed-off-by: Akinobu Mita Cc: "Theodore Ts'o" Cc: Huang Ying Signed-off-by: Andrew Morton --- diff --git a/lib/uuid.c b/lib/uuid.c index 52a6fe6387de..398821e4dce1 100644 --- a/lib/uuid.c +++ b/lib/uuid.c @@ -25,13 +25,7 @@ static void __uuid_gen_common(__u8 b[16]) { - int i; - u32 r; - - for (i = 0; i < 4; i++) { - r = random32(); - memcpy(b + i * 4, &r, 4); - } + prandom_bytes(b, 16); /* reversion 0b10 */ b[8] = (b[8] & 0x3F) | 0x80; }