Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2cc44e63 authored by Wei Yongjun's avatar Wei Yongjun Committed by Vinod Koul
Browse files

dma: tegra: use list_move_tail instead of list_del/list_add_tail

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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@linux.intel.com>
parent 5e97fa91
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -475,8 +475,7 @@ static void tegra_dma_abort_all(struct tegra_dma_channel *tdc)
	while (!list_empty(&tdc->pending_sg_req)) {
	while (!list_empty(&tdc->pending_sg_req)) {
		sgreq = list_first_entry(&tdc->pending_sg_req,
		sgreq = list_first_entry(&tdc->pending_sg_req,
						typeof(*sgreq), node);
						typeof(*sgreq), node);
		list_del(&sgreq->node);
		list_move_tail(&sgreq->node, &tdc->free_sg_req);
		list_add_tail(&sgreq->node, &tdc->free_sg_req);
		if (sgreq->last_sg) {
		if (sgreq->last_sg) {
			dma_desc = sgreq->dma_desc;
			dma_desc = sgreq->dma_desc;
			dma_desc->dma_status = DMA_ERROR;
			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 not last req then put at end of pending list */
	if (!list_is_last(&sgreq->node, &tdc->pending_sg_req)) {
	if (!list_is_last(&sgreq->node, &tdc->pending_sg_req)) {
		list_del(&sgreq->node);
		list_move_tail(&sgreq->node, &tdc->pending_sg_req);
		list_add_tail(&sgreq->node, &tdc->pending_sg_req);
		sgreq->configured = false;
		sgreq->configured = false;
		st = handle_continuous_head_request(tdc, sgreq, to_terminate);
		st = handle_continuous_head_request(tdc, sgreq, to_terminate);
		if (!st)
		if (!st)