Message ID | 1337954309-18178-1-git-send-email-s.hauer@pengutronix.de |
---|---|
State | New, archived |
Headers | show |
On Fri, 2012-05-25 at 15:58 +0200, Sascha Hauer wrote: > the random number generation in the mtd stresstest was changed from a > homebrew generator to random32. random32 generates unsigned random > numbers, but the values are assigned to signed integers. This results > in negative offsets, eraseblocks and writesized. Fix it by using unsigned > integers for these variables instead. Pushed to l2-mtd.git, thanks!
diff --git a/drivers/mtd/tests/mtd_stresstest.c b/drivers/mtd/tests/mtd_stresstest.c index 52ea178..cb268ce 100644 --- a/drivers/mtd/tests/mtd_stresstest.c +++ b/drivers/mtd/tests/mtd_stresstest.c @@ -52,7 +52,7 @@ static int pgcnt; static int rand_eb(void) { - int eb; + unsigned int eb; again: eb = random32(); @@ -65,7 +65,7 @@ again: static int rand_offs(void) { - int offs; + unsigned int offs; offs = random32(); offs %= bufsize; @@ -74,7 +74,7 @@ static int rand_offs(void) static int rand_len(int offs) { - int len; + unsigned int len; len = random32(); len %= (bufsize - offs);