aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nandsim.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/nandsim.c')
-rw-r--r--drivers/mtd/nand/nandsim.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index 818b65c85d12..4c317982fce5 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -1476,12 +1476,12 @@ int do_read_error(struct nandsim *ns, int num)
1476 1476
1477void do_bit_flips(struct nandsim *ns, int num) 1477void do_bit_flips(struct nandsim *ns, int num)
1478{ 1478{
1479 if (bitflips && random32() < (1 << 22)) { 1479 if (bitflips && prandom_u32() < (1 << 22)) {
1480 int flips = 1; 1480 int flips = 1;
1481 if (bitflips > 1) 1481 if (bitflips > 1)
1482 flips = (random32() % (int) bitflips) + 1; 1482 flips = (prandom_u32() % (int) bitflips) + 1;
1483 while (flips--) { 1483 while (flips--) {
1484 int pos = random32() % (num * 8); 1484 int pos = prandom_u32() % (num * 8);
1485 ns->buf.byte[pos / 8] ^= (1 << (pos % 8)); 1485 ns->buf.byte[pos / 8] ^= (1 << (pos % 8));
1486 NS_WARN("read_page: flipping bit %d in page %d " 1486 NS_WARN("read_page: flipping bit %d in page %d "
1487 "reading from %d ecc: corrected=%u failed=%u\n", 1487 "reading from %d ecc: corrected=%u failed=%u\n",