From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Luo Meng <luomeng12@huawei.com>
Cc: <richard@nod.at>, <vigneshr@ti.com>, <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH] mtd: remove unneeded return statment in mtdswap_write_marker()
Date: Fri, 9 Apr 2021 09:58:43 +0200 [thread overview]
Message-ID: <20210409095843.13750145@xps13> (raw)
In-Reply-To: <20210409075622.2111788-1-luomeng12@huawei.com>
Hi Luo,
Luo Meng <luomeng12@huawei.com> wrote on Fri, 9 Apr 2021 15:56:22 +0800:
> It should be impossible 'ret !=0' and 'ops.oobretlen != ops.ooblen',
Why do you say it's impossible?
> So remove the unneeded return statment.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Luo Meng <luomeng12@huawei.com>
> ---
> drivers/mtd/mtdswap.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c
> index 795dec4483c2..12bacb4ae9de 100644
> --- a/drivers/mtd/mtdswap.c
> +++ b/drivers/mtd/mtdswap.c
> @@ -398,12 +398,10 @@ static int mtdswap_write_marker(struct mtdswap_dev *d, struct swap_eb *eb,
> return ret;
> }
>
> - if (ops.oobretlen != ops.ooblen) {
> + if (ops.oobretlen != ops.ooblen)
> dev_warn(d->dev, "Short OOB write for block at %08llx: "
> "%zd not %zd\n",
> offset, ops.oobretlen, ops.ooblen);
Why do you keep the condition if it's impossible?
Why would you keep the dev_warn and return 0?
> - return ret;
> - }
>
> return 0;
> }
I think this patch can be safely discarded.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2021-04-09 8:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-09 7:56 [PATCH] mtd: remove unneeded return statment in mtdswap_write_marker() Luo Meng
2021-04-09 7:58 ` Miquel Raynal [this message]
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=20210409095843.13750145@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=linux-mtd@lists.infradead.org \
--cc=luomeng12@huawei.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.