All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] spi-stm32: fix Coccinelle warnings
@ 2021-08-20  3:19 ` CGEL
  0 siblings, 0 replies; 4+ messages in thread
From: CGEL @ 2021-08-20  3:19 UTC (permalink / raw)
  To: Alain Volmat
  Cc: Mark Brown, Maxime Coquelin, Alexandre Torgue, linux-spi,
	linux-stm32, linux-arm-kernel, linux-kernel, jing yangyang,
	Zeal Robot

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 --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;
 	}
 
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-20  6:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-20  3:19 [PATCH linux-next] spi-stm32: fix Coccinelle warnings CGEL
2021-08-20  3:19 ` CGEL
2021-08-20  6:32 ` Alain Volmat
2021-08-20  6:32   ` Alain Volmat

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.