spi: rzv2m-csi: Replace unnecessary ternary operators
authorFabrizio Castro <fabrizio.castro.jz@renesas.com>
Sat, 15 Jul 2023 01:04:02 +0000 (02:04 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Jul 2023 11:41:44 +0000 (12:41 +0100)
The ternary operators used to initialize tx_completed and rx_completed
are not necessary, replace them with a better implementation.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230715010407.1751715-6-fabrizio.castro.jz@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-rzv2m-csi.c

index 1c65cd5f2039a53ce2b60fb6bb078585edd5bcea..038f1486b7d7b47db05a75f7e4224c2f54ec180a 100644 (file)
@@ -439,8 +439,8 @@ static int rzv2m_csi_setup(struct spi_device *spi)
 
 static int rzv2m_csi_pio_transfer(struct rzv2m_csi_priv *csi)
 {
-       bool tx_completed = csi->txbuf ? false : true;
-       bool rx_completed = csi->rxbuf ? false : true;
+       bool tx_completed = !csi->txbuf;
+       bool rx_completed = !csi->rxbuf;
        int ret = 0;
 
        /* Make sure the TX FIFO is empty */