[PATCH v2 1/7] mtd: nandsim: remove the abuse of reference to globle variable.

Dongsheng Yang yangds.fnst at cn.fujitsu.com
Sat Dec 12 00:41:01 PST 2015


The function of do_bit_flips() is working on struct nandsim, where
we can not see struct mtd_info which in a higher level of view.

This patch remove reference to nsmtd in do_bit_flips(). If you want
to get the same information of it, please print it in the mtd level.

Signed-off-by: Dongsheng Yang <yangds.fnst at cn.fujitsu.com>
---
 drivers/mtd/nand/nandsim.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index 95d0cc4..d4a94c4 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -1456,9 +1456,8 @@ static void do_bit_flips(struct nandsim *ns, int num)
 			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",
-				pos, ns->regs.row, ns->regs.column + ns->regs.off,
-				nsmtd->ecc_stats.corrected, nsmtd->ecc_stats.failed);
+				"reading from %d\n",
+				pos, ns->regs.row, ns->regs.column + ns->regs.off);
 		}
 	}
 }
-- 
1.8.4.2






More information about the linux-mtd mailing list