Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b7e905e authored by Roman Tereshonkov's avatar Roman Tereshonkov Committed by David Woodhouse
Browse files

mtd: tests: print correct values



The ebcnt and pgcnt variable initialization is moved before printk
which uses them.

Signed-off-by: default avatarRoman Tereshonkov <roman.tereshonkov@nokia.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 3ee7451a
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -394,6 +394,11 @@ static int __init mtd_subpagetest_init(void)
	}
	}


	subpgsize = mtd->writesize >> mtd->subpage_sft;
	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, "
	printk(PRINT_PREF "MTD device size %llu, eraseblock size %u, "
	       "page size %u, subpage size %u, count of eraseblocks %u, "
	       "page size %u, subpage size %u, count of eraseblocks %u, "
	       "pages per eraseblock %u, OOB size %u\n",
	       "pages per eraseblock %u, OOB size %u\n",
@@ -413,11 +418,6 @@ static int __init mtd_subpagetest_init(void)
		goto out;
		goto out;
	}
	}


	tmp = mtd->size;
	do_div(tmp, mtd->erasesize);
	ebcnt = tmp;
	pgcnt = mtd->erasesize / mtd->writesize;

	err = scan_for_bad_eraseblocks();
	err = scan_for_bad_eraseblocks();
	if (err)
	if (err)
		goto out;
		goto out;