]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/mtd/nand/nandsim.c
Merge tag 'for-linus-20130301' of git://git.infradead.org/linux-mtd
[karo-tx-linux.git] / drivers / mtd / nand / nandsim.c
index 8f30d385bfa3d82bdf47608b25d1f74ca5637137..891c52a30e6a48468d593926261ea8eee23260d9 100644 (file)
@@ -1468,12 +1468,12 @@ int do_read_error(struct nandsim *ns, int num)
 
 void do_bit_flips(struct nandsim *ns, int num)
 {
-       if (bitflips && random32() < (1 << 22)) {
+       if (bitflips && prandom_u32() < (1 << 22)) {
                int flips = 1;
                if (bitflips > 1)
-                       flips = (random32() % (int) bitflips) + 1;
+                       flips = (prandom_u32() % (int) bitflips) + 1;
                while (flips--) {
-                       int pos = random32() % (num * 8);
+                       int pos = prandom_u32() % (num * 8);
                        ns->buf.byte[pos / 8] ^= (1 << (pos % 8));
                        NS_WARN("read_page: flipping bit %d in page %d "
                                "reading from %d ecc: corrected=%u failed=%u\n",