Skip to content

Commit 2f57b8d

Browse files
fabioestevamvinodkoul
authored andcommitted
dmaengine: imx-sdma: Fix: Remove 'always true' comparison
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: 25962e1 ("dmaengine: imx-sdma: Fix the event id check to include RX event for UART6") Reported-by: kernel test robot <[email protected]> Signed-off-by: Fabio Estevam <[email protected]> Reviewed-by: Frieder Schrempf <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 1aea5c1 commit 2f57b8d

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/dma/imx-sdma.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,8 +1331,7 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
13311331

13321332
sdma_channel_synchronize(chan);
13331333

1334-
if (sdmac->event_id0 >= 0)
1335-
sdma_event_disable(sdmac, sdmac->event_id0);
1334+
sdma_event_disable(sdmac, sdmac->event_id0);
13361335
if (sdmac->event_id1)
13371336
sdma_event_disable(sdmac, sdmac->event_id1);
13381337

@@ -1632,11 +1631,9 @@ static int sdma_config(struct dma_chan *chan,
16321631
memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg));
16331632

16341633
/* Set ENBLn earlier to make sure dma request triggered after that */
1635-
if (sdmac->event_id0 >= 0) {
1636-
if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
1637-
return -EINVAL;
1638-
sdma_event_enable(sdmac, sdmac->event_id0);
1639-
}
1634+
if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
1635+
return -EINVAL;
1636+
sdma_event_enable(sdmac, sdmac->event_id0);
16401637

16411638
if (sdmac->event_id1) {
16421639
if (sdmac->event_id1 >= sdmac->sdma->drvdata->num_events)

0 commit comments

Comments
 (0)