diff mbox series

[linux-next] spi-stm32: fix Coccinelle warnings

Message ID 20210820031952.12746-1-jing.yangyang@zte.com.cn
State New
Headers show
Series [linux-next] spi-stm32: fix Coccinelle warnings | expand

Commit Message

Lv Ruyi Aug. 20, 2021, 3:19 a.m. UTC
From: jing yangyang <jing.yangyang@zte.com.cn>

WARNING !A || A && B is equivalent to !A || B

This issue was detected with the help of Coccinelle.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: jing yangyang <jing.yangyang@zte.com.cn>
---
 drivers/spi/spi-stm32.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index 14ca7ea..cc4a731 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -912,8 +912,8 @@  static irqreturn_t stm32h7_spi_irq_thread(int irq, void *dev_id)
 		if (!spi->cur_usedma && (spi->rx_buf && (spi->rx_len > 0)))
 			stm32h7_spi_read_rxfifo(spi);
 		if (!spi->cur_usedma ||
-		    (spi->cur_usedma && (spi->cur_comm == SPI_SIMPLEX_TX ||
-		     spi->cur_comm == SPI_3WIRE_TX)))
+			(spi->cur_comm == SPI_SIMPLEX_TX ||
+			spi->cur_comm == SPI_3WIRE_TX))
 			end = true;
 	}