From: Xiaolei Li Date: Thu, 1 Jun 2017 09:01:19 +0000 (+0800) Subject: mtd: subpagetest: fix wrong written check in function write_eraseblock2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c46adf0976eacadd60920da5b8bf8e27299183bd;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Richard Weinberger Acked-by: Boris Brezillon Signed-off-by: Brian Norris --- diff --git a/drivers/mtd/tests/subpagetest.c b/drivers/mtd/tests/subpagetest.c index aecc6ce5a9e1..fa2519ad2435 100644 --- a/drivers/mtd/tests/subpagetest.c +++ b/drivers/mtd/tests/subpagetest.c @@ -102,7 +102,7 @@ static int write_eraseblock2(int ebnum) if (unlikely(err || written != subpgsize * k)) { pr_err("error: write failed at %#llx\n", (long long)addr); - if (written != subpgsize) { + if (written != subpgsize * k) { pr_err(" write size: %#x\n", subpgsize * k); pr_err(" written: %#08zx\n",