diff mbox series

[-next] dmaengine: sun4i: Use list_move_tail instead of list_del/list_add_tail

Message ID 1623036035-30614-1-git-send-email-zou_wei@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] dmaengine: sun4i: Use list_move_tail instead of list_del/list_add_tail | expand

Commit Message

Zou Wei June 7, 2021, 3:20 a.m. UTC
Using list_move_tail() instead of list_del() + list_add_tail().

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
---
 drivers/dma/sun4i-dma.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Maxime Ripard June 7, 2021, 8:41 a.m. UTC | #1
On Mon, Jun 07, 2021 at 11:20:35AM +0800, Zou Wei wrote:
> Using list_move_tail() instead of list_del() + list_add_tail().
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zou Wei <zou_wei@huawei.com>

Acked-by: Maxime Ripard <maxime@cerno.tech>

Thanks!
Maxime
Vinod Koul June 7, 2021, 11:36 a.m. UTC | #2
On 07-06-21, 11:20, Zou Wei wrote:
> Using list_move_tail() instead of list_del() + list_add_tail().

Applied, thanks
diff mbox series

Patch

diff --git a/drivers/dma/sun4i-dma.c b/drivers/dma/sun4i-dma.c
index e8b6633..93f1645 100644
--- a/drivers/dma/sun4i-dma.c
+++ b/drivers/dma/sun4i-dma.c
@@ -1042,9 +1042,8 @@  static irqreturn_t sun4i_dma_interrupt(int irq, void *dev_id)
 			 * Move the promise into the completed list now that
 			 * we're done with it
 			 */
-			list_del(&vchan->processing->list);
-			list_add_tail(&vchan->processing->list,
-				      &contract->completed_demands);
+			list_move_tail(&vchan->processing->list,
+				       &contract->completed_demands);
 
 			/*
 			 * Cyclic DMA transfers are special: