summaryrefslogtreecommitdiffstats
path: root/commands/nandtest.c
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@googlemail.com>2012-10-22 09:23:29 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-10-23 08:27:33 +0200
commitc4f2e01df3734de04b0000621bd1e694864f5498 (patch)
tree2d66be875c12fa6b2d955defa684beea678a0ded /commands/nandtest.c
parentbada8f57a6d9ffbda76dcc77263ed49a18eecdbb (diff)
downloadbarebox-c4f2e01df3734de04b0000621bd1e694864f5498.tar.gz
nandtest: use get_random_bytes instead of for loop
Use already builtin get_random_bytes instead of for loop. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/nandtest.c')
-rw-r--r--commands/nandtest.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/commands/nandtest.c b/commands/nandtest.c
index e25f062..cdf9c31 100644
--- a/commands/nandtest.c
+++ b/commands/nandtest.c
@@ -198,7 +198,6 @@ static int do_nandtest(int argc, char *argv[])
int opt, do_nandtest_dev = -1;
off_t flash_offset = 0, test_ofs, length = 0;
unsigned int nr_iterations = 1, iter;
- int i;
int ret = -1;
unsigned char *wbuf, *rbuf;
@@ -328,9 +327,7 @@ static int do_nandtest(int argc, char *argv[])
continue;
}
- for (i = 0; i < meminfo.erasesize; i++)
- wbuf[i] = rand();
-
+ get_random_bytes(wbuf, meminfo.erasesize);
ret = erase_and_write(test_ofs, wbuf,
rbuf, length);
if (ret < 0)