[PATCH 5/8] nandtest: use get_random_bytes instead of for loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use already builtin get_random_bytes instead of for loop.

Signed-off-by: Alexander Aring <alex.aring@xxxxxxxxx>
---
 commands/nandtest.c | 5 +----
 1 file changed, 1 insertion(+), 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)
-- 
1.7.12.4


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux