From: Akinobu Mita Date: Thu, 29 Nov 2012 03:19:13 +0000 (+1100) Subject: mtd: mtd_speedtest: use prandom_bytes X-Git-Tag: next-20121205~1^2~27 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a31b52ea9d26c4f4e1931ab25595cd8d45cb9553;p=karo-tx-linux.git mtd: mtd_speedtest: use prandom_bytes Use prandom_bytes instead of equivalent local function. Signed-off-by: Akinobu Mita Cc: Artem Bityutskiy Cc: David Woodhouse Cc: "Theodore Ts'o" Cc: Adrian Hunter Cc: David Laight Cc: Eilon Greenstein Cc: Michel Lespinasse Cc: Robert Love Cc: Valdis Kletnieks Signed-off-by: Andrew Morton --- diff --git a/drivers/mtd/tests/mtd_speedtest.c b/drivers/mtd/tests/mtd_speedtest.c index 596cbea8df4c..a6ce9c1fa6c5 100644 --- a/drivers/mtd/tests/mtd_speedtest.c +++ b/drivers/mtd/tests/mtd_speedtest.c @@ -49,13 +49,6 @@ static int pgcnt; static int goodebcnt; static struct timeval start, finish; -static void set_random_data(unsigned char *buf, size_t len) -{ - size_t i; - - for (i = 0; i < len; ++i) - buf[i] = random32(); -} static int erase_eraseblock(int ebnum) { @@ -396,7 +389,7 @@ static int __init mtd_speedtest_init(void) goto out; } - set_random_data(iobuf, mtd->erasesize); + prandom_bytes(iobuf, mtd->erasesize); err = scan_for_bad_eraseblocks(); if (err)