Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: stm32: fix excluded_middle.cocci warnings

drivers/spi/spi-stm32.c:915:23-25: WARNING !A || A && B is equivalent to !A || B

Condition !A || A && B is equivalent to !A || B.

Generated by: scripts/coccinelle/misc/excluded_middle.cocci

Fixes: 7ceb0b8a3ced ("spi: stm32: finalize message either on dma callback or EOT")
CC: Alain Volmat <alain.volmat@foss.st.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Reviewed-by: Alain Volmat <alain.volmat@foss.st.com>
Link: https://lore.kernel.org/r/20210713191004.GA14729@5eb5c2cbef84
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

kernel test robot and committed by
Mark Brown
7a4697b2 02cea703

+1 -2
+1 -2
drivers/spi/spi-stm32.c
··· 912 912 if (!spi->cur_usedma && (spi->rx_buf && (spi->rx_len > 0))) 913 913 stm32h7_spi_read_rxfifo(spi); 914 914 if (!spi->cur_usedma || 915 - (spi->cur_usedma && (spi->cur_comm == SPI_SIMPLEX_TX || 916 - spi->cur_comm == SPI_3WIRE_TX))) 915 + (spi->cur_comm == SPI_SIMPLEX_TX || spi->cur_comm == SPI_3WIRE_TX)) 917 916 end = true; 918 917 } 919 918