From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 2 Jun 2017 09:14:44 +0200 From: Boris Brezillon To: Cc: , , , Subject: Re: [PATCH] mtd: subpagetest: fix wrong written check in function write_eraseblock2 Message-ID: <20170602091444.1f1e1d1d@bbrezillon> In-Reply-To: <1496307679-16245-1-git-send-email-xiaolei.li@mediatek.com> References: <1496307679-16245-1-git-send-email-xiaolei.li@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thu, 1 Jun 2017 17:01:19 +0800 wrote: > From: Xiaolei Li > > 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 Acked-by: Boris Brezillon > --- > 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",