mtd: spi-nor: cqspi: remove redundant dead code on error return check
Subsystems (3)
PATCH 1/1 mtd: spi-nor: cqspi: remove redundant dead code on error return check
From: Colin Ian King <[email protected]>
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
--- drivers/mtd/spi-nor/cadence-quadspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/spi-nor/cadence-quadspi.c +2 -2
@@ -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)
Signature · 1 line
2.10.2
Am 31.01.2017 um 16:53 schrieb Colin King:
Quoted 7 lines
From: Colin Ian King <[email protected]>
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 <[email protected]>
Thanks,
//richard
Quoted 7 lines · Colin King
From: Colin Ian King <[email protected]>
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 <[email protected]>
Thanks
Quoted 27 lines
--- drivers/mtd/spi-nor/cadence-quadspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mtd/spi-nor/cadence-quadspi.c +2
-2@@ -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)
Signature · 2 lines
Best regards, Marek Vasut
Cyrille Pitchen
AppliedQuoted 7 lines · Colin King
From: Colin Ian King <[email protected]>
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 <[email protected]>
Applied to the github spi-nor tree.
Thanks!
Quoted 27 lines
--- drivers/mtd/spi-nor/cadence-quadspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mtd/spi-nor/cadence-quadspi.c +2
-2@@ -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)