Skip to content

Commit 745649c

Browse files
Colin Ian Kingbroonie
authored andcommitted
spi: rockchip-sfc: Fix assigned but never used return error codes
Currently there are two places where the error return variable ret is being assigned -ETIMEDOUT on timeout errors and this value is not being returned. Fix this by returning -ETIMEDOUT rather than redundantly assiging it to ret. Addresses-Coverity: ("Unused value") Fixes: 0b89fc0 ("spi: rockchip-sfc: add rockchip serial flash controller") Signed-off-by: Colin Ian King <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 8d00f98 commit 745649c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/spi/spi-rockchip-sfc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static int rockchip_sfc_wait_txfifo_ready(struct rockchip_sfc *sfc, u32 timeout_
257257
if (ret) {
258258
dev_dbg(sfc->dev, "sfc wait tx fifo timeout\n");
259259

260-
ret = -ETIMEDOUT;
260+
return -ETIMEDOUT;
261261
}
262262

263263
return (status & SFC_FSR_TXLV_MASK) >> SFC_FSR_TXLV_SHIFT;
@@ -274,7 +274,7 @@ static int rockchip_sfc_wait_rxfifo_ready(struct rockchip_sfc *sfc, u32 timeout_
274274
if (ret) {
275275
dev_dbg(sfc->dev, "sfc wait rx fifo timeout\n");
276276

277-
ret = -ETIMEDOUT;
277+
return -ETIMEDOUT;
278278
}
279279

280280
return (status & SFC_FSR_RXLV_MASK) >> SFC_FSR_RXLV_SHIFT;

0 commit comments

Comments
 (0)