lkml.org 
[lkml]   [2015]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mtd: Add simple read disturb test
Am 02.04.2015 um 17:02 schrieb Fabio Estevam:
> On Thu, Apr 2, 2015 at 11:13 AM, Richard Weinberger <richard@nod.at> wrote:
>
>> + ret = mtdtest_erase_eraseblock(mtd, i);
>> + if (ret) {
>> + err = ret;
>> + goto out;
>> + }
>
> Why not just do like this instead?
>
> err = mtdtest_erase_eraseblock(mtd, i);
> if (err)
> goto out;
>
>> +
>> + ret = mtdtest_write(mtd, i * mtd->erasesize, mtd->erasesize,
>> + iobuf_orig);
>> + if (ret) {
>> + err = ret;
>> + goto out;
>> + }
>
> Same here.

The real question is why did I use ret and err at all? ;)
This test is based on existing tests, thus it got copy&pasted.
I'll think about merging these two variables.
Thank for pointing this out.


>> + ret = mtdtest_relax();
>> + if (ret)
>> + goto out;
>
> Here you propagate the wrong error. You test for 'ret' and propagate 'err'.

This is by design. I don't want to print an error message if the test is aborted.
mtdtest_relax() checks for that.

Thanks,
//richard


\
 
 \ /
  Last update: 2015-04-02 18:01    [W:0.112 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site