Skip to contentSkip to conversation

dmaengine: fsl-dpaa2-qdma: Use list_move_tail instead of list_del/list_add_tail

PATCH Applied Baokun Li 2 participants 2 messages Jun 9, 2021 – Jul 28, 2021

Subsystems (2)
lore
Share & tools
lore

Baokun Li

author
#0 lore raw

PATCH v2 1/1 dmaengine: fsl-dpaa2-qdma: Use list_move_tail instead of list_del/list_add_tail

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

---
V1->V2:
CC mailist

 drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c +3 -5
index 4ae057922ef1..a0358f2c5cbb 100644
@@ -291,9 +291,8 @@ static void dpaa2_qdma_issue_pending(struct dma_chan *chan)
 
 		err = dpaa2_io_service_enqueue_fq(NULL, dpaa2_chan->fqid, fd);
 		if (err) {
-			list_del(&dpaa2_comp->list);
-			list_add_tail(&dpaa2_comp->list,
-				      &dpaa2_chan->comp_free);
+			list_move_tail(&dpaa2_comp->list,
+				       &dpaa2_chan->comp_free);
 		}
 	}
 err_enqueue:
@@ -626,8 +625,7 @@ static void dpaa2_qdma_free_desc(struct virt_dma_desc *vdesc)
 	dpaa2_comp = to_fsl_qdma_comp(vdesc);
 	qchan = dpaa2_comp->qchan;
 	spin_lock_irqsave(&qchan->queue_lock, flags);
-	list_del(&dpaa2_comp->list);
-	list_add_tail(&dpaa2_comp->list, &qchan->comp_free);
+	list_move_tail(&dpaa2_comp->list, &qchan->comp_free);
 	spin_unlock_irqrestore(&qchan->queue_lock, flags);
 }
 
maintainer Applied
#1 lore raw
Quoted 1 line · Baokun Li

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

Applied, thanks

Signature · 1 line
~Vinod