All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alain Volmat <alain.volmat@foss.st.com>
To: CGEL <cgel.zte@gmail.com>
Cc: Mark Brown <broonie@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	<linux-spi@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	jing yangyang <jing.yangyang@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH linux-next] spi-stm32: fix Coccinelle warnings
Date: Fri, 20 Aug 2021 08:32:02 +0200	[thread overview]
Message-ID: <20210820063202.GA21711@gnbcxd0016.gnb.st.com> (raw)
In-Reply-To: <20210820031952.12746-1-jing.yangyang@zte.com.cn>

Hi,

thanks for the patch. We've had this issue reported previously with a patch
provided at
(https://lore.kernel.org/linux-spi/20210713191004.GA14729@5eb5c2cbef84/).
I've put my reviewed-by so it should make its way to the linux-next soon.

Regards,
Alain

On Thu, Aug 19, 2021 at 08:19:52PM -0700, CGEL wrote:
> 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
> 
> 

WARNING: multiple messages have this Message-ID
From: Alain Volmat <alain.volmat@foss.st.com>
To: CGEL <cgel.zte@gmail.com>
Cc: Mark Brown <broonie@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	<linux-spi@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	jing yangyang <jing.yangyang@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH linux-next] spi-stm32: fix Coccinelle warnings
Date: Fri, 20 Aug 2021 08:32:02 +0200	[thread overview]
Message-ID: <20210820063202.GA21711@gnbcxd0016.gnb.st.com> (raw)
In-Reply-To: <20210820031952.12746-1-jing.yangyang@zte.com.cn>

Hi,

thanks for the patch. We've had this issue reported previously with a patch
provided at
(https://lore.kernel.org/linux-spi/20210713191004.GA14729@5eb5c2cbef84/).
I've put my reviewed-by so it should make its way to the linux-next soon.

Regards,
Alain

On Thu, Aug 19, 2021 at 08:19:52PM -0700, CGEL wrote:
> 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
> 
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-08-20  6:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-08-20  6:32   ` Alain Volmat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210820063202.GA21711@gnbcxd0016.gnb.st.com \
    --to=alain.volmat@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=broonie@kernel.org \
    --cc=cgel.zte@gmail.com \
    --cc=jing.yangyang@zte.com.cn \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.