2021-07-13 19:11:43

by kernel test robot

[permalink] [raw]
Subject: [PATCH] spi: stm32: fix excluded_middle.cocci warnings

From: kernel test robot <[email protected]>

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 <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 8f0df15bafc1e1c92b6d96bf8ef24dd8be3aec7b
commit: 7ceb0b8a3ceddc36ae4ef1cba6c25a0e28ed65fc [1012/1340] spi: stm32: finalize message either on dma callback or EOT
:::::: branch date: 11 hours ago
:::::: commit date: 2 days ago

spi-stm32.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -912,8 +912,7 @@ static irqreturn_t stm32h7_spi_irq_threa
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;
}


2021-07-26 09:58:01

by Alain Volmat

[permalink] [raw]
Subject: Re: [PATCH] spi: stm32: fix excluded_middle.cocci warnings

Thanks.

Reviewed-by: Alain Volmat <[email protected]>

On Wed, Jul 14, 2021 at 03:10:04AM +0800, kernel test robot wrote:
> From: kernel test robot <[email protected]>
>
> 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 <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Signed-off-by: kernel test robot <[email protected]>
> ---
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: 8f0df15bafc1e1c92b6d96bf8ef24dd8be3aec7b
> commit: 7ceb0b8a3ceddc36ae4ef1cba6c25a0e28ed65fc [1012/1340] spi: stm32: finalize message either on dma callback or EOT
> :::::: branch date: 11 hours ago
> :::::: commit date: 2 days ago
>
> spi-stm32.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> --- a/drivers/spi/spi-stm32.c
> +++ b/drivers/spi/spi-stm32.c
> @@ -912,8 +912,7 @@ static irqreturn_t stm32h7_spi_irq_threa
> 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;
> }
>

2021-08-20 14:40:48

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] spi: stm32: fix excluded_middle.cocci warnings

On Wed, 14 Jul 2021 03:10:04 +0800, kernel test robot wrote:
> From: kernel test robot <[email protected]>
>
> 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.
>
> [...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: stm32: fix excluded_middle.cocci warnings
commit: 7a4697b201a617907e4b440ae34df601d4755bef

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark