diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2013-01-03 07:19:13 -0500 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2013-02-04 02:26:28 -0500 |
commit | aca662a3b1c9b178536267da9fb2f0faa798cb7f (patch) | |
tree | e75eea8674411ec01fd03d689d59f0727a487fca /drivers/mtd/nand | |
parent | bd6ce5ef913a7b4dfe5cd5028309346d32a8c404 (diff) |
mtd: rename random32() to prandom_u32()
Use more preferable function name which implies using a pseudo-random
number generator.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r-- | drivers/mtd/nand/nandsim.c | 6 |
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 | ||
1477 | void do_bit_flips(struct nandsim *ns, int num) | 1477 | void 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", |