Skip to content

Commit

Permalink
mtd: tests: print correct values
Browse files Browse the repository at this point in the history
The ebcnt and pgcnt variable initialization is moved before printk
which uses them.

Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Roman Tereshonkov authored and David Woodhouse committed Mar 11, 2011
1 parent 3ee7451 commit 7b7e905
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/mtd/tests/mtd_subpagetest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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;
Expand Down

0 comments on commit 7b7e905

Please sign in to comment.