[PATCH] mtd: tests: remove useless checks

Jonas Gorski jonas.gorski at gmail.com
Sat Sep 2 03:32:45 PDT 2023


Hi,

On Fri, 1 Sept 2023 at 15:39, Dembskiy Igor <dii at itb.spb.ru> wrote:
>
> Return value of mtdtest_scan_for_bad_() is always 0. So it causes senseless

Your function name got cut off.

> checks in some functions such as mtd_subpagetest_init().

Then maybe it should return void?

> Fixes: 084db4b020c7 ("mtd: tests: introduce helper functions")
> Signed-off-by: Dembskiy Igor <dii at itb.spb.ru>
> ---
>  drivers/mtd/tests/oobtest.c     | 2 --
>  drivers/mtd/tests/pagetest.c    | 2 --
>  drivers/mtd/tests/readtest.c    | 2 --
>  drivers/mtd/tests/speedtest.c   | 3 +--
>  drivers/mtd/tests/stresstest.c  | 2 --
>  drivers/mtd/tests/subpagetest.c | 2 --
>  drivers/mtd/tests/torturetest.c | 2 --
>  7 files changed, 1 insertion(+), 14 deletions(-)
>
> diff --git a/drivers/mtd/tests/oobtest.c b/drivers/mtd/tests/oobtest.c
> index 13fed398937e..976f40a5656e 100644
> --- a/drivers/mtd/tests/oobtest.c
> +++ b/drivers/mtd/tests/oobtest.c
> @@ -399,8 +399,6 @@ static int __init mtd_oobtest_init(void)
>         pr_info("test 1 of 5\n");
>
>         err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt);
> -       if (err)
> -               goto out;

That's not mtdtest_scan_for_bad_eraseblocks().

Regards,
Jonas



More information about the linux-mtd mailing list