linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: stm32-mdma: Remove dead code in stm32_mdma_irq_handler()
@ 2022-06-12 22:23 Alexey Khoroshilov
  2022-06-15 14:42 ` Amelie Delaunay
  2022-06-16 16:04 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Khoroshilov @ 2022-06-12 22:23 UTC (permalink / raw)
  To: Vinod Koul, Amelie Delaunay
  Cc: Alexey Khoroshilov, dmaengine, linux-stm32, linux-kernel, ldv-project

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")
---
 drivers/dma/stm32-mdma.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c
index caf0cce8f528..b11927ed4367 100644
--- a/drivers/dma/stm32-mdma.c
+++ b/drivers/dma/stm32-mdma.c
@@ -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);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dmaengine: stm32-mdma: Remove dead code in stm32_mdma_irq_handler()
  2022-06-12 22:23 [PATCH] dmaengine: stm32-mdma: Remove dead code in stm32_mdma_irq_handler() Alexey Khoroshilov
@ 2022-06-15 14:42 ` Amelie Delaunay
  2022-06-16 16:04 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Amelie Delaunay @ 2022-06-15 14:42 UTC (permalink / raw)
  To: Alexey Khoroshilov, Vinod Koul, Amelie Delaunay
  Cc: dmaengine, linux-stm32, linux-kernel, ldv-project

Hi Alexey,

On 6/13/22 00:23, Alexey Khoroshilov wrote:
> 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")
> ---
>   drivers/dma/stm32-mdma.c | 5 -----
>   1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c
> index caf0cce8f528..b11927ed4367 100644
> --- a/drivers/dma/stm32-mdma.c
> +++ b/drivers/dma/stm32-mdma.c
> @@ -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);

Thanks for your patch,

Reviewed-by: Amelie Delaunay <amelie.delaunay@foss.st.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dmaengine: stm32-mdma: Remove dead code in stm32_mdma_irq_handler()
  2022-06-12 22:23 [PATCH] dmaengine: stm32-mdma: Remove dead code in stm32_mdma_irq_handler() Alexey Khoroshilov
  2022-06-15 14:42 ` Amelie Delaunay
@ 2022-06-16 16:04 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2022-06-16 16:04 UTC (permalink / raw)
  To: Alexey Khoroshilov
  Cc: Amelie Delaunay, dmaengine, linux-stm32, linux-kernel, ldv-project

On 13-06-22, 01:23, Alexey Khoroshilov wrote:
> 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.

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-16 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-12 22:23 [PATCH] dmaengine: stm32-mdma: Remove dead code in stm32_mdma_irq_handler() Alexey Khoroshilov
2022-06-15 14:42 ` Amelie Delaunay
2022-06-16 16:04 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).