mtd: tests: print correct values

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Mar 11 10:59:03 EST 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=7b7e905ec2ec511e06279181ca95a892db21e292
Commit:     7b7e905ec2ec511e06279181ca95a892db21e292
Parent:     3ee7451a023dd197fcfc1ba46dcce6d8ec5e1b78
Author:     Roman Tereshonkov <roman.tereshonkov at nokia.com>
AuthorDate: Thu Feb 3 13:45:56 2011 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Mar 11 14:22:44 2011 +0000

    mtd: tests: print correct values
    
    The ebcnt and pgcnt variable initialization is moved before printk
    which uses them.
    
    Signed-off-by: Roman Tereshonkov <roman.tereshonkov at nokia.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/tests/mtd_subpagetest.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

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;



More information about the linux-mtd-cvs mailing list