* [PATCH] mtd: remove redundant assignment to pointer eb
@ 2020-09-11 10:23 Colin King
2020-09-11 15:55 ` Miquel Raynal
2021-01-04 10:18 ` Miquel Raynal
0 siblings, 2 replies; 4+ messages in thread
From: Colin King @ 2020-09-11 10:23 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, linux-mtd
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Pointer eb is being assigned a value that is never read, the assignment
is redundant and can be removed.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/mtd/mtdswap.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c
index 58eefa43af14..795dec4483c2 100644
--- a/drivers/mtd/mtdswap.c
+++ b/drivers/mtd/mtdswap.c
@@ -1053,7 +1053,6 @@ static int mtdswap_writesect(struct mtd_blktrans_dev *dev,
if (ret < 0)
return ret;
- eb = d->eb_data + (newblock / d->pages_per_eblk);
d->page_data[page] = newblock;
return 0;
--
2.27.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: remove redundant assignment to pointer eb
2020-09-11 10:23 [PATCH] mtd: remove redundant assignment to pointer eb Colin King
@ 2020-09-11 15:55 ` Miquel Raynal
2020-12-13 22:22 ` Richard Weinberger
2021-01-04 10:18 ` Miquel Raynal
1 sibling, 1 reply; 4+ messages in thread
From: Miquel Raynal @ 2020-09-11 15:55 UTC (permalink / raw)
To: Colin King
Cc: Richard Weinberger, Vignesh Raghavendra, linux-mtd,
kernel-janitors, linux-kernel
Hi Colin,
Colin King <colin.king@canonical.com> wrote on Fri, 11 Sep 2020
11:23:21 +0100:
> From: Colin Ian King <colin.king@canonical.com>
>
> Pointer eb is being assigned a value that is never read, the assignment
> is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/mtd/mtdswap.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c
> index 58eefa43af14..795dec4483c2 100644
> --- a/drivers/mtd/mtdswap.c
> +++ b/drivers/mtd/mtdswap.c
> @@ -1053,7 +1053,6 @@ static int mtdswap_writesect(struct mtd_blktrans_dev *dev,
> if (ret < 0)
> return ret;
>
> - eb = d->eb_data + (newblock / d->pages_per_eblk);
> d->page_data[page] = newblock;
>
> return 0;
Yes it looks unused but perhaps it helps to catch the logic here. This
is not a strong disagreement but I'd keep it this way. Let's see what
other maintainers think.
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: remove redundant assignment to pointer eb
2020-09-11 15:55 ` Miquel Raynal
@ 2020-12-13 22:22 ` Richard Weinberger
0 siblings, 0 replies; 4+ messages in thread
From: Richard Weinberger @ 2020-12-13 22:22 UTC (permalink / raw)
To: Miquel Raynal
Cc: Colin King, Richard Weinberger, Vignesh Raghavendra, linux-mtd,
kernel-janitors, LKML
On Fri, Sep 11, 2020 at 5:59 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Colin,
>
> Colin King <colin.king@canonical.com> wrote on Fri, 11 Sep 2020
> 11:23:21 +0100:
>
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > Pointer eb is being assigned a value that is never read, the assignment
> > is redundant and can be removed.
> >
> > Addresses-Coverity: ("Unused value")
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > ---
> > drivers/mtd/mtdswap.c | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c
> > index 58eefa43af14..795dec4483c2 100644
> > --- a/drivers/mtd/mtdswap.c
> > +++ b/drivers/mtd/mtdswap.c
> > @@ -1053,7 +1053,6 @@ static int mtdswap_writesect(struct mtd_blktrans_dev *dev,
> > if (ret < 0)
> > return ret;
> >
> > - eb = d->eb_data + (newblock / d->pages_per_eblk);
> > d->page_data[page] = newblock;
> >
> > return 0;
>
> Yes it looks unused but perhaps it helps to catch the logic here. This
> is not a strong disagreement but I'd keep it this way. Let's see what
> other maintainers think.
This looks like dead code, let's rip it out.
--
Thanks,
//richard
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: remove redundant assignment to pointer eb
2020-09-11 10:23 [PATCH] mtd: remove redundant assignment to pointer eb Colin King
2020-09-11 15:55 ` Miquel Raynal
@ 2021-01-04 10:18 ` Miquel Raynal
1 sibling, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2021-01-04 10:18 UTC (permalink / raw)
To: Colin King, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-mtd
Cc: kernel-janitors, linux-kernel
On Fri, 2020-09-11 at 10:23:21 UTC, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Pointer eb is being assigned a value that is never read, the assignment
> is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
Miquel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-01-04 10:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11 10:23 [PATCH] mtd: remove redundant assignment to pointer eb Colin King
2020-09-11 15:55 ` Miquel Raynal
2020-12-13 22:22 ` Richard Weinberger
2021-01-04 10:18 ` Miquel Raynal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).