public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Dembskiy Igor <dii@itb.spb.ru>
Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Richard Weinberger <richard@nod.at>,
	Akinobu Mita <akinobu.mita@gmail.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	lvc-project@linuxtesting.org
Subject: Re: [PATCH] mtd: tests: remove useless checks
Date: Fri, 1 Sep 2023 15:42:42 +0200	[thread overview]
Message-ID: <20230901154242.12417f09@xps-13> (raw)
In-Reply-To: <20230901133641.60817-1-dii@itb.spb.ru>

Hi Igor,

dii@itb.spb.ru wrote on Fri,  1 Sep 2023 16:36:41 +0300:

> Return value of mtdtest_scan_for_bad_() is always 0. So it causes senseless
> checks in some functions such as mtd_subpagetest_init().
> 
> Fixes: 084db4b020c7 ("mtd: tests: introduce helper functions")
> Signed-off-by: Dembskiy Igor <dii@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;

What's the point of keeping "err =" or even keeping a return value if
void would be more appropriate?

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2023-09-01 13:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-01 13:36 [PATCH] mtd: tests: remove useless checks Dembskiy Igor
2023-09-01 13:42 ` Miquel Raynal [this message]
2023-09-02 10:32 ` Jonas Gorski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230901154242.12417f09@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=akinobu.mita@gmail.com \
    --cc=bbrezillon@kernel.org \
    --cc=dii@itb.spb.ru \
    --cc=khoroshilov@ispras.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox