mtd: subpagetest: fix wrong written check in function write_eraseblock2

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Jul 13 10:59:04 PDT 2017


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=c46adf0976eacadd60920da5b8bf8e27299183bd
Commit:     c46adf0976eacadd60920da5b8bf8e27299183bd
Parent:     4379075a870b8de43a9ecd5b46884953234fc669
Author:     Xiaolei Li <xiaolei.li at mediatek.com>
AuthorDate: Thu Jun 1 17:01:19 2017 +0800
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Thu Jun 8 16:39:21 2017 -0700

    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 at mediatek.com>
    Reviewed-by: Richard Weinberger <richard at nod.at>
    Acked-by: Boris Brezillon <boris.brezillon at free-electrons.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/tests/subpagetest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/tests/subpagetest.c b/drivers/mtd/tests/subpagetest.c
index aecc6ce..fa2519a 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",



More information about the linux-mtd-cvs mailing list