linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dma: tegra: use list_move_tail instead of list_del/list_add_tail
@ 2012-09-05  7:08 Wei Yongjun
  2012-09-07  6:32 ` Laxman Dewangan
  2012-09-14  3:09 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2012-09-05  7:08 UTC (permalink / raw)
  To: vinod.koul, djbw, grant.likely, rob.herring
  Cc: yongjun_wei, linux-kernel, devicetree-discuss

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Using list_move_tail() instead of list_del() + list_add_tail().

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/dma/tegra20-apb-dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index 24acd71..6ed3f43 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -475,8 +475,7 @@ static void tegra_dma_abort_all(struct tegra_dma_channel *tdc)
 	while (!list_empty(&tdc->pending_sg_req)) {
 		sgreq = list_first_entry(&tdc->pending_sg_req,
 						typeof(*sgreq), node);
-		list_del(&sgreq->node);
-		list_add_tail(&sgreq->node, &tdc->free_sg_req);
+		list_move_tail(&sgreq->node, &tdc->free_sg_req);
 		if (sgreq->last_sg) {
 			dma_desc = sgreq->dma_desc;
 			dma_desc->dma_status = DMA_ERROR;
@@ -570,8 +569,7 @@ static void handle_cont_sngl_cycle_dma_done(struct tegra_dma_channel *tdc,
 
 	/* If not last req then put at end of pending list */
 	if (!list_is_last(&sgreq->node, &tdc->pending_sg_req)) {
-		list_del(&sgreq->node);
-		list_add_tail(&sgreq->node, &tdc->pending_sg_req);
+		list_move_tail(&sgreq->node, &tdc->pending_sg_req);
 		sgreq->configured = false;
 		st = handle_continuous_head_request(tdc, sgreq, to_terminate);
 		if (!st)



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

* Re: [PATCH] dma: tegra: use list_move_tail instead of list_del/list_add_tail
  2012-09-05  7:08 [PATCH] dma: tegra: use list_move_tail instead of list_del/list_add_tail Wei Yongjun
@ 2012-09-07  6:32 ` Laxman Dewangan
  2012-09-14  3:09 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Laxman Dewangan @ 2012-09-07  6:32 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: vinod.koul, djbw, grant.likely, rob.herring, yongjun_wei,
	linux-kernel, devicetree-discuss

On Wednesday 05 September 2012 12:38 PM, Wei Yongjun wrote:
> From: Wei Yongjun<yongjun_wei@trendmicro.com.cn>
>
> Using list_move_tail() instead of list_del() + list_add_tail().
>
> spatch with a semantic match is used to found this problem.
> (http://coccinelle.lip6.fr/)
>
> Signed-off-by: Wei Yongjun<yongjun_wei@trendmicro.com.cn>
> ---
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Looks good to me.


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

* Re: [PATCH] dma: tegra: use list_move_tail instead of list_del/list_add_tail
  2012-09-05  7:08 [PATCH] dma: tegra: use list_move_tail instead of list_del/list_add_tail Wei Yongjun
  2012-09-07  6:32 ` Laxman Dewangan
@ 2012-09-14  3:09 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2012-09-14  3:09 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: djbw, grant.likely, rob.herring, yongjun_wei, linux-kernel,
	devicetree-discuss

On Wed, 2012-09-05 at 15:08 +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Using list_move_tail() instead of list_del() + list_add_tail().
> 
> spatch with a semantic match is used to found this problem.
> (http://coccinelle.lip6.fr/)
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Applied thanks
> ---
>  drivers/dma/tegra20-apb-dma.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
> index 24acd71..6ed3f43 100644
> --- a/drivers/dma/tegra20-apb-dma.c
> +++ b/drivers/dma/tegra20-apb-dma.c
> @@ -475,8 +475,7 @@ static void tegra_dma_abort_all(struct tegra_dma_channel *tdc)
>  	while (!list_empty(&tdc->pending_sg_req)) {
>  		sgreq = list_first_entry(&tdc->pending_sg_req,
>  						typeof(*sgreq), node);
> -		list_del(&sgreq->node);
> -		list_add_tail(&sgreq->node, &tdc->free_sg_req);
> +		list_move_tail(&sgreq->node, &tdc->free_sg_req);
>  		if (sgreq->last_sg) {
>  			dma_desc = sgreq->dma_desc;
>  			dma_desc->dma_status = DMA_ERROR;
> @@ -570,8 +569,7 @@ static void handle_cont_sngl_cycle_dma_done(struct tegra_dma_channel *tdc,
>  
>  	/* If not last req then put at end of pending list */
>  	if (!list_is_last(&sgreq->node, &tdc->pending_sg_req)) {
> -		list_del(&sgreq->node);
> -		list_add_tail(&sgreq->node, &tdc->pending_sg_req);
> +		list_move_tail(&sgreq->node, &tdc->pending_sg_req);
>  		sgreq->configured = false;
>  		st = handle_continuous_head_request(tdc, sgreq, to_terminate);
>  		if (!st)
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


-- 
~Vinod


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

end of thread, other threads:[~2012-09-14  3:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-05  7:08 [PATCH] dma: tegra: use list_move_tail instead of list_del/list_add_tail Wei Yongjun
2012-09-07  6:32 ` Laxman Dewangan
2012-09-14  3:09 ` 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).