]> git.karo-electronics.de Git - linux-beck.git/commitdiff
spi: spi-xilinx: cleanup a check in xilinx_spi_txrx_bufs()
authordan.carpenter@oracle.com <dan.carpenter@oracle.com>
Sun, 9 Jun 2013 13:07:28 +0000 (16:07 +0300)
committerMark Brown <broonie@linaro.org>
Mon, 10 Jun 2013 09:28:04 +0000 (10:28 +0100)
'!' 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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-xilinx.c

index 34d18dcfa0db3c4da739129b1d1008f18ee06cfc..109a535b639c98dabc48dcde9a14b3d8fda33617 100644 (file)
@@ -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 */
-               if (!xspi->remaining_bytes > 0)
+               if (xspi->remaining_bytes <= 0)
                        break;
        }