DMA Engine development
 help / color / mirror / Atom feed
From: Schrempf Frieder <frieder.schrempf@kontron.de>
To: Fabio Estevam <festevam@gmail.com>,
	"vkoul@kernel.org" <vkoul@kernel.org>
Cc: "dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	"linux-imx@nxp.com" <linux-imx@nxp.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] dmaengine: imx-sdma: Fix: Remove 'always true' comparison
Date: Mon, 22 Jun 2020 15:29:55 +0000	[thread overview]
Message-ID: <5f38f9c0-711f-9cbb-09a4-49f51f879fcb@kontron.de> (raw)
In-Reply-To: <20200621155730.28766-1-festevam@gmail.com>

On 21.06.20 17:57, Fabio Estevam wrote:
> event_id0 is defined as 'unsigned int', so it is always greater or
> equal to zero.
> 
> Remove the unneeded comparisons to fix the following W=1 build
> warning:
> 
> drivers/dma/imx-sdma.c: In function 'sdma_free_chan_resources':
> drivers/dma/imx-sdma.c:1334:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
> 1334 |  if (sdmac->event_id0 >= 0)
> |                       ^~
> drivers/dma/imx-sdma.c: In function 'sdma_config':
> drivers/dma/imx-sdma.c:1635:23: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
> 1635 |  if (sdmac->event_id0 >= 0) {
> |
> 
> Fixes: 25962e1a7f1d ("dmaengine: imx-sdma: Fix the event id check to include RX event for UART6")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>

Thanks!

Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>

> ---
>   drivers/dma/imx-sdma.c | 11 ++++-------
>   1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index 91774039ae5d..270992c4fe47 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -1331,8 +1331,7 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
>   
>   	sdma_channel_synchronize(chan);
>   
> -	if (sdmac->event_id0 >= 0)
> -		sdma_event_disable(sdmac, sdmac->event_id0);
> +	sdma_event_disable(sdmac, sdmac->event_id0);
>   	if (sdmac->event_id1)
>   		sdma_event_disable(sdmac, sdmac->event_id1);
>   
> @@ -1632,11 +1631,9 @@ static int sdma_config(struct dma_chan *chan,
>   	memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg));
>   
>   	/* Set ENBLn earlier to make sure dma request triggered after that */
> -	if (sdmac->event_id0 >= 0) {
> -		if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
> -			return -EINVAL;
> -		sdma_event_enable(sdmac, sdmac->event_id0);
> -	}
> +	if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
> +		return -EINVAL;
> +	sdma_event_enable(sdmac, sdmac->event_id0);
>   
>   	if (sdmac->event_id1) {
>   		if (sdmac->event_id1 >= sdmac->sdma->drvdata->num_events)
> 

  reply	other threads:[~2020-06-22 15:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-21 15:57 [PATCH] dmaengine: imx-sdma: Fix: Remove 'always true' comparison Fabio Estevam
2020-06-22 15:29 ` Schrempf Frieder [this message]
2020-06-24  5:46 ` Vinod Koul

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=5f38f9c0-711f-9cbb-09a4-49f51f879fcb@kontron.de \
    --to=frieder.schrempf@kontron.de \
    --cc=dmaengine@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=vkoul@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox