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

mtd: subpagetest: fix wrong written check in function write_eraseblock2

Write size in function write_eraseblock2 is subpgsize * k.
It is wrong to check whether written is equal to subpgsize after each
mtd_write.

Signed-off-by: Xiaolei Li <xiaolei.li@mediatek.com>
Reviewed-by: Richard Weinberger <richard@nod.at>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>

authored by

Xiaolei Li and committed by
Brian Norris
c46adf09 4379075a

+1 -1
+1 -1
drivers/mtd/tests/subpagetest.c
··· 102 102 if (unlikely(err || written != subpgsize * k)) { 103 103 pr_err("error: write failed at %#llx\n", 104 104 (long long)addr); 105 - if (written != subpgsize) { 105 + if (written != subpgsize * k) { 106 106 pr_err(" write size: %#x\n", 107 107 subpgsize * k); 108 108 pr_err(" written: %#08zx\n",