diff mbox

mtd: tests : move ebcnt and pgcnt definitions before usage in printing.

Message ID 1296733556-22196-1-git-send-email-roman.tereshonkov@nokia.com
State Accepted
Commit 7b7e905ec2ec511e06279181ca95a892db21e292
Headers show

Commit Message

Roman Tereshonkov Feb. 3, 2011, 11:45 a.m. UTC
ebcnt and pgcnt variable initialization is moved before printk which
uses them.

Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
---
 drivers/mtd/tests/mtd_subpagetest.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

Comments

Artem Bityutskiy Feb. 6, 2011, 3:12 p.m. UTC | #1
On Thu, 2011-02-03 at 13:45 +0200, Roman Tereshonkov wrote:
> ebcnt and pgcnt variable initialization is moved before printk which
> uses them.
> 
> Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>

Pushed to l2-mtd-2.6.git, thanks!
diff mbox

Patch

diff --git a/drivers/mtd/tests/mtd_subpagetest.c b/drivers/mtd/tests/mtd_subpagetest.c
index 11204e8..334eae5 100644
--- a/drivers/mtd/tests/mtd_subpagetest.c
+++ b/drivers/mtd/tests/mtd_subpagetest.c
@@ -394,6 +394,11 @@  static int __init mtd_subpagetest_init(void)
 	}
 
 	subpgsize = mtd->writesize >> mtd->subpage_sft;
+	tmp = mtd->size;
+	do_div(tmp, mtd->erasesize);
+	ebcnt = tmp;
+	pgcnt = mtd->erasesize / mtd->writesize;
+
 	printk(PRINT_PREF "MTD device size %llu, eraseblock size %u, "
 	       "page size %u, subpage size %u, count of eraseblocks %u, "
 	       "pages per eraseblock %u, OOB size %u\n",
@@ -413,11 +418,6 @@  static int __init mtd_subpagetest_init(void)
 		goto out;
 	}
 
-	tmp = mtd->size;
-	do_div(tmp, mtd->erasesize);
-	ebcnt = tmp;
-	pgcnt = mtd->erasesize / mtd->writesize;
-
 	err = scan_for_bad_eraseblocks();
 	if (err)
 		goto out;