DMA Engine development
 help / color / mirror / Atom feed
* [07/20] dmaengine: at_hdmac: drop useless LIST_HEAD
@ 2018-12-23  8:57 Julia Lawall
  0 siblings, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2018-12-23  8:57 UTC (permalink / raw)
  To: Ludovic Desroches
  Cc: kernel-janitors, Vinod Koul, Dan Williams, linux-arm-kernel,
	dmaengine, linux-kernel

Drop LIST_HEAD where the variable it declares is never used.

tmp_list has been declared since the introduction of the driver
and has never been used.  The two declarations of list were
introduced with the containing functions but were also not used.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier x;
@@
- LIST_HEAD(x);
  ... when != x
// </smpl>

Fixes: dc78baa2b90b ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller")
Fixes: 4facfe7f09f2b ("dmaengine: hdmac: Split device_control")
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
Successfully 0-day tested on 151 configurations.

 drivers/dma/at_hdmac.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 01d936c9fe89..a0a9cd76c1d4 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -134,7 +134,6 @@ static struct at_desc *atc_desc_get(struct at_dma_chan *atchan)
 	struct at_desc *ret = NULL;
 	unsigned long flags;
 	unsigned int i = 0;
-	LIST_HEAD(tmp_list);
 
 	spin_lock_irqsave(&atchan->lock, flags);
 	list_for_each_entry_safe(desc, _desc, &atchan->free_list, desc_node) {
@@ -1387,8 +1386,6 @@ static int atc_pause(struct dma_chan *chan)
 	int			chan_id = atchan->chan_common.chan_id;
 	unsigned long		flags;
 
-	LIST_HEAD(list);
-
 	dev_vdbg(chan2dev(chan), "%s\n", __func__);
 
 	spin_lock_irqsave(&atchan->lock, flags);
@@ -1408,8 +1405,6 @@ static int atc_resume(struct dma_chan *chan)
 	int			chan_id = atchan->chan_common.chan_id;
 	unsigned long		flags;
 
-	LIST_HEAD(list);
-
 	dev_vdbg(chan2dev(chan), "%s\n", __func__);
 
 	if (!atc_chan_is_paused(atchan))

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

* [07/20] dmaengine: at_hdmac: drop useless LIST_HEAD
@ 2018-12-24  9:36 Ludovic Desroches
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Desroches @ 2018-12-24  9:36 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Vinod Koul, Dan Williams, linux-arm-kernel,
	dmaengine, linux-kernel

On Sun, Dec 23, 2018 at 09:57:02AM +0100, Julia Lawall wrote:
> Drop LIST_HEAD where the variable it declares is never used.
> 
> tmp_list has been declared since the introduction of the driver
> and has never been used.  The two declarations of list were
> introduced with the containing functions but were also not used.
> 
> The semantic patch that fixes this problem is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> identifier x;
> @@
> - LIST_HEAD(x);
>   ... when != x
> // </smpl>
> 
> Fixes: dc78baa2b90b ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller")
> Fixes: 4facfe7f09f2b ("dmaengine: hdmac: Split device_control")
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com> 

Thanks
> 
> ---
> Successfully 0-day tested on 151 configurations.
> 
>  drivers/dma/at_hdmac.c |    5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
> index 01d936c9fe89..a0a9cd76c1d4 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c
> @@ -134,7 +134,6 @@ static struct at_desc *atc_desc_get(struct at_dma_chan *atchan)
>  	struct at_desc *ret = NULL;
>  	unsigned long flags;
>  	unsigned int i = 0;
> -	LIST_HEAD(tmp_list);
>  
>  	spin_lock_irqsave(&atchan->lock, flags);
>  	list_for_each_entry_safe(desc, _desc, &atchan->free_list, desc_node) {
> @@ -1387,8 +1386,6 @@ static int atc_pause(struct dma_chan *chan)
>  	int			chan_id = atchan->chan_common.chan_id;
>  	unsigned long		flags;
>  
> -	LIST_HEAD(list);
> -
>  	dev_vdbg(chan2dev(chan), "%s\n", __func__);
>  
>  	spin_lock_irqsave(&atchan->lock, flags);
> @@ -1408,8 +1405,6 @@ static int atc_resume(struct dma_chan *chan)
>  	int			chan_id = atchan->chan_common.chan_id;
>  	unsigned long		flags;
>  
> -	LIST_HEAD(list);
> -
>  	dev_vdbg(chan2dev(chan), "%s\n", __func__);
>  
>  	if (!atc_chan_is_paused(atchan))
>

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

* [07/20] dmaengine: at_hdmac: drop useless LIST_HEAD
@ 2019-01-02  6:04 Vinod Koul
  0 siblings, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2019-01-02  6:04 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Ludovic Desroches, kernel-janitors, Dan Williams,
	linux-arm-kernel, dmaengine, linux-kernel

On 23-12-18, 09:57, Julia Lawall wrote:
> Drop LIST_HEAD where the variable it declares is never used.
> 
> tmp_list has been declared since the introduction of the driver
> and has never been used.  The two declarations of list were
> introduced with the containing functions but were also not used.
> 
> The semantic patch that fixes this problem is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> identifier x;
> @@
> - LIST_HEAD(x);
>   ... when != x
> // </smpl>

Applied with Ludovic's ack, thanks

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

end of thread, other threads:[~2019-01-02  6:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-02  6:04 [07/20] dmaengine: at_hdmac: drop useless LIST_HEAD Vinod Koul
  -- strict thread matches above, loose matches on Subject: below --
2018-12-24  9:36 Ludovic Desroches
2018-12-23  8:57 Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox