Patchwork Fix mtd readtest, speedtest and stresstest for NOR devices

login
register
mail settings
Submitter Morten Thunberg Svendsen
Date Dec. 16, 2009, 2:04 p.m.
Message ID <1260972246-15345-1-git-send-email-mts@doredevelopment.dk>
Download mbox | patch
Permalink /patch/41263/
State New, archived
Headers show

Comments

Morten Thunberg Svendsen - Dec. 16, 2009, 2:04 p.m.
From: Morten Thunberg Svendsen <mts.doredevelopment@gmail.com>

Ignore previous patch. mtd->writesize is 1 for NOR devices, use pgsize as it will be 512 for NOR devices and writesize if writesize != 1. 

Signed-off-by: Morten Thunberg Svendsen <mts.doredevelopment@gmail.com>
---
 drivers/mtd/tests/mtd_readtest.c   |    2 +-
 drivers/mtd/tests/mtd_speedtest.c  |    2 +-
 drivers/mtd/tests/mtd_stresstest.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/drivers/mtd/tests/mtd_readtest.c b/drivers/mtd/tests/mtd_readtest.c
index 402137f..25c5dd0 100644
--- a/drivers/mtd/tests/mtd_readtest.c
+++ b/drivers/mtd/tests/mtd_readtest.c
@@ -188,7 +188,7 @@  static int __init mtd_readtest_init(void)
 	tmp = mtd->size;
 	do_div(tmp, mtd->erasesize);
 	ebcnt = tmp;
-	pgcnt = mtd->erasesize / mtd->writesize;
+	pgcnt = mtd->erasesize / pgsize;
 
 	printk(PRINT_PREF "MTD device size %llu, eraseblock size %u, "
 	       "page size %u, count of eraseblocks %u, pages per "
diff --git a/drivers/mtd/tests/mtd_speedtest.c b/drivers/mtd/tests/mtd_speedtest.c
index c5bb159..2c1c625 100644
--- a/drivers/mtd/tests/mtd_speedtest.c
+++ b/drivers/mtd/tests/mtd_speedtest.c
@@ -344,7 +344,7 @@  static int __init mtd_speedtest_init(void)
 	tmp = mtd->size;
 	do_div(tmp, mtd->erasesize);
 	ebcnt = tmp;
-	pgcnt = mtd->erasesize / mtd->writesize;
+	pgcnt = mtd->erasesize / pgsize;
 
 	printk(PRINT_PREF "MTD device size %llu, eraseblock size %u, "
 	       "page size %u, count of eraseblocks %u, pages per "
diff --git a/drivers/mtd/tests/mtd_stresstest.c b/drivers/mtd/tests/mtd_stresstest.c
index 48672f7..a99d3cd 100644
--- a/drivers/mtd/tests/mtd_stresstest.c
+++ b/drivers/mtd/tests/mtd_stresstest.c
@@ -269,7 +269,7 @@  static int __init mtd_stresstest_init(void)
 	tmp = mtd->size;
 	do_div(tmp, mtd->erasesize);
 	ebcnt = tmp;
-	pgcnt = mtd->erasesize / mtd->writesize;
+	pgcnt = mtd->erasesize / pgsize;
 
 	printk(PRINT_PREF "MTD device size %llu, eraseblock size %u, "
 	       "page size %u, count of eraseblocks %u, pages per "