提交 e33d085d 编写于 作者: D dan.carpenter@oracle.com 提交者: Mark Brown

spi: spi-xilinx: cleanup a check in xilinx_spi_txrx_bufs()

'!' has higher precedence than comparisons so the original condition
is equivalent to "if (xspi->remaining_bytes == 0)".  This makes the
static checkers complain.

xspi->remaining_bytes is signed and from looking at the code
briefly, I think it might be able to go negative.  I suspect that
going negative may cause a bug, but I don't have the hardware and
can't test.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 68c315bb
...@@ -315,7 +315,7 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t) ...@@ -315,7 +315,7 @@ static int xilinx_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
} }
/* See if there is more data to send */ /* See if there is more data to send */
if (!xspi->remaining_bytes > 0) if (xspi->remaining_bytes <= 0)
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册