]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dmaengine: ep93xx: Fix unsigned compared against 0
authorAdvait Dhamorikar <advaitdhamorikar@gmail.com>
Sat, 5 Oct 2024 09:34:36 +0000 (15:04 +0530)
committerVinod Koul <vkoul@kernel.org>
Mon, 14 Oct 2024 18:15:37 +0000 (23:45 +0530)
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>
drivers/dma/ep93xx_dma.c

index 995427afe0773df1bb45154148fa45d62e53a19d..6d7f6bd12d766cc26664b20ccc65d04f2754037f 100644 (file)
@@ -929,8 +929,7 @@ static int ep93xx_dma_alloc_chan_resources(struct dma_chan *chan)
 
        /* Sanity check the channel parameters */
        if (!edmac->edma->m2m) {
-               if (edmac->dma_cfg.port < EP93XX_DMA_I2S1 ||
-                   edmac->dma_cfg.port > EP93XX_DMA_IRDA)
+               if (edmac->dma_cfg.port > EP93XX_DMA_IRDA)
                        return -EINVAL;
                if (edmac->dma_cfg.dir != ep93xx_dma_chan_direction(chan))
                        return -EINVAL;