Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

authored by

Roman Tereshonkov and committed by
David Woodhouse
7b7e905e 3ee7451a

+5 -5
+5 -5
drivers/mtd/tests/mtd_subpagetest.c
··· 394 394 } 395 395 396 396 subpgsize = mtd->writesize >> mtd->subpage_sft; 397 + tmp = mtd->size; 398 + do_div(tmp, mtd->erasesize); 399 + ebcnt = tmp; 400 + pgcnt = mtd->erasesize / mtd->writesize; 401 + 397 402 printk(PRINT_PREF "MTD device size %llu, eraseblock size %u, " 398 403 "page size %u, subpage size %u, count of eraseblocks %u, " 399 404 "pages per eraseblock %u, OOB size %u\n", ··· 417 412 printk(PRINT_PREF "error: cannot allocate memory\n"); 418 413 goto out; 419 414 } 420 - 421 - tmp = mtd->size; 422 - do_div(tmp, mtd->erasesize); 423 - ebcnt = tmp; 424 - pgcnt = mtd->erasesize / mtd->writesize; 425 415 426 416 err = scan_for_bad_eraseblocks(); 427 417 if (err)