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

dmaengine: ep93xx: Fix unsigned compared against 0

An unsigned value can never be negative,
so this test will always evaluate the same way.
In ep93xx_dma_alloc_chan_resources: An unsigned dma_cfg.port's
value is checked against EP93XX_DMA_I2S1 which is 0.

Signed-off-by: Advait Dhamorikar <advaitdhamorikar@gmail.com>
Link: https://lore.kernel.org/r/20241005093436.27728-1-advaitdhamorikar@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Advait Dhamorikar and committed by
Vinod Koul
0aa4523c 662f0453

+1 -2
+1 -2
drivers/dma/ep93xx_dma.c
··· 929 929 930 930 /* Sanity check the channel parameters */ 931 931 if (!edmac->edma->m2m) { 932 - if (edmac->dma_cfg.port < EP93XX_DMA_I2S1 || 933 - edmac->dma_cfg.port > EP93XX_DMA_IRDA) 932 + if (edmac->dma_cfg.port > EP93XX_DMA_IRDA) 934 933 return -EINVAL; 935 934 if (edmac->dma_cfg.dir != ep93xx_dma_chan_direction(chan)) 936 935 return -EINVAL;