提交 7fa2c703 编写于 作者: C Colin Ian King 提交者: Cyrille Pitchen

mtd: spi-nor: cqspi: remove redundant dead code on error return check

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: NColin Ian King <colin.king@canonical.com>
Reviewed-by: NRichard Weinberger <richard@nod.at>
Acked-by: NMarek Vasut <marek.vasut@gmail.com>
Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com>
上级 35fd7661
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册