Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1570842 > unrolled thread
| Started by | Colin King <colin.king@canonical.com> |
|---|---|
| First post | 2017-01-31 17:00 +0100 |
| Last post | 2017-02-02 10:50 +0100 |
| Articles | 4 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH] mtd: spi-nor: cqspi: remove redundant dead code on error return check Colin King <colin.king@canonical.com> - 2017-01-31 17:00 +0100
Re: [PATCH] mtd: spi-nor: cqspi: remove redundant dead code on error return check Richard Weinberger <richard@nod.at> - 2017-01-31 17:50 +0100
Re: [PATCH] mtd: spi-nor: cqspi: remove redundant dead code on error return check Marek Vasut <marek.vasut@gmail.com> - 2017-01-31 20:50 +0100
Re: [PATCH] mtd: spi-nor: cqspi: remove redundant dead code on error return check Cyrille Pitchen <cyrille.pitchen@atmel.com> - 2017-02-02 10:50 +0100
| From | Colin King <colin.king@canonical.com> |
|---|---|
| Date | 2017-01-31 17:00 +0100 |
| Subject | [PATCH] mtd: spi-nor: cqspi: remove redundant dead code on error return check |
| Message-ID | <t5J0B-2tO-5@gated-at.bofh.it> |
From: Colin Ian King <colin.king@canonical.com> Checking for ret < 0 is redundant because a previous check on ret being non-zero already handles the ret < 0 case. Remove the redundant code. Found by CoverityScan, CID#1398863, CID#1398864 Signed-off-by: Colin Ian King <colin.king@canonical.com> --- drivers/mtd/spi-nor/cadence-quadspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c index 3fb7be8..9f8102d 100644 --- a/drivers/mtd/spi-nor/cadence-quadspi.c +++ b/drivers/mtd/spi-nor/cadence-quadspi.c @@ -893,7 +893,7 @@ static ssize_t cqspi_write(struct spi_nor *nor, loff_t to, if (ret) return ret; - return (ret < 0) ? ret : len; + return len; } static ssize_t cqspi_read(struct spi_nor *nor, loff_t from, @@ -913,7 +913,7 @@ static ssize_t cqspi_read(struct spi_nor *nor, loff_t from, if (ret) return ret; - return (ret < 0) ? ret : len; + return len; } static int cqspi_erase(struct spi_nor *nor, loff_t offs) -- 2.10.2
[toc] | [next] | [standalone]
| From | Richard Weinberger <richard@nod.at> |
|---|---|
| Date | 2017-01-31 17:50 +0100 |
| Subject | Re: [PATCH] mtd: spi-nor: cqspi: remove redundant dead code on error return check |
| Message-ID | <t5JMZ-2ZV-1@gated-at.bofh.it> |
| In reply to | #1570842 |
Am 31.01.2017 um 16:53 schrieb Colin King: > From: Colin Ian King <colin.king@canonical.com> > > Checking for ret < 0 is redundant because a previous check on ret > being non-zero already handles the ret < 0 case. Remove the redundant > code. Found by CoverityScan, CID#1398863, CID#1398864 > > Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Richard Weinberger <richard@nod.at> Thanks, //richard
[toc] | [prev] | [next] | [standalone]
| From | Marek Vasut <marek.vasut@gmail.com> |
|---|---|
| Date | 2017-01-31 20:50 +0100 |
| Subject | Re: [PATCH] mtd: spi-nor: cqspi: remove redundant dead code on error return check |
| Message-ID | <t5MBd-4Gh-25@gated-at.bofh.it> |
| In reply to | #1570842 |
On 01/31/2017 04:53 PM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > Checking for ret < 0 is redundant because a previous check on ret > being non-zero already handles the ret < 0 case. Remove the redundant > code. Found by CoverityScan, CID#1398863, CID#1398864 > > Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Marek Vasut <marek.vasut@gmail.com> Thanks > --- > drivers/mtd/spi-nor/cadence-quadspi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c > index 3fb7be8..9f8102d 100644 > --- a/drivers/mtd/spi-nor/cadence-quadspi.c > +++ b/drivers/mtd/spi-nor/cadence-quadspi.c > @@ -893,7 +893,7 @@ static ssize_t cqspi_write(struct spi_nor *nor, loff_t to, > if (ret) > return ret; > > - return (ret < 0) ? ret : len; > + return len; > } > > static ssize_t cqspi_read(struct spi_nor *nor, loff_t from, > @@ -913,7 +913,7 @@ static ssize_t cqspi_read(struct spi_nor *nor, loff_t from, > if (ret) > return ret; > > - return (ret < 0) ? ret : len; > + return len; > } > > static int cqspi_erase(struct spi_nor *nor, loff_t offs) > -- Best regards, Marek Vasut
[toc] | [prev] | [next] | [standalone]
| From | Cyrille Pitchen <cyrille.pitchen@atmel.com> |
|---|---|
| Date | 2017-02-02 10:50 +0100 |
| Subject | Re: [PATCH] mtd: spi-nor: cqspi: remove redundant dead code on error return check |
| Message-ID | <t6mbD-26H-11@gated-at.bofh.it> |
| In reply to | #1570842 |
Le 31/01/2017 à 16:53, Colin King a écrit : > From: Colin Ian King <colin.king@canonical.com> > > Checking for ret < 0 is redundant because a previous check on ret > being non-zero already handles the ret < 0 case. Remove the redundant > code. Found by CoverityScan, CID#1398863, CID#1398864 > > Signed-off-by: Colin Ian King <colin.king@canonical.com> Applied to the github spi-nor tree. Thanks! > --- > drivers/mtd/spi-nor/cadence-quadspi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c > index 3fb7be8..9f8102d 100644 > --- a/drivers/mtd/spi-nor/cadence-quadspi.c > +++ b/drivers/mtd/spi-nor/cadence-quadspi.c > @@ -893,7 +893,7 @@ static ssize_t cqspi_write(struct spi_nor *nor, loff_t to, > if (ret) > return ret; > > - return (ret < 0) ? ret : len; > + return len; > } > > static ssize_t cqspi_read(struct spi_nor *nor, loff_t from, > @@ -913,7 +913,7 @@ static ssize_t cqspi_read(struct spi_nor *nor, loff_t from, > if (ret) > return ret; > > - return (ret < 0) ? ret : len; > + return len; > } > > static int cqspi_erase(struct spi_nor *nor, loff_t offs) >
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web