OSDN Git Service

dmaengine: stm32-mdma: Remove dead code in stm32_mdma_irq_handler()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Sun, 12 Jun 2022 22:23:58 +0000 (01:23 +0300)
committerVinod Koul <vkoul@kernel.org>
Thu, 16 Jun 2022 16:04:09 +0000 (09:04 -0700)
Local variable chan is initialized by an address of element of chan array
that is part of stm32_mdma_device struct, so it does not make sense to
compare chan with NULL.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Fixes: a4ffb13c8946 ("dmaengine: Add STM32 MDMA driver")
Reviewed-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/1655072638-9103-1-git-send-email-khoroshilov@ispras.ru
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/stm32-mdma.c

index caf0cce..b11927e 100644 (file)
@@ -1328,12 +1328,7 @@ static irqreturn_t stm32_mdma_irq_handler(int irq, void *devid)
                return IRQ_NONE;
        }
        id = __ffs(status);
-
        chan = &dmadev->chan[id];
-       if (!chan) {
-               dev_warn(mdma2dev(dmadev), "MDMA channel not initialized\n");
-               return IRQ_NONE;
-       }
 
        /* Handle interrupt for the channel */
        spin_lock(&chan->vchan.lock);