[PATCH -next] soc: fsl: dpio: use list_move_tail instead of list_del/list_add_tail

Zou Wei zou_wei at huawei.com
Tue Jun 8 10:50:32 AEST 2021


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

Reported-by: Hulk Robot <hulkci at huawei.com>
Signed-off-by: Zou Wei <zou_wei at huawei.com>
---
 drivers/soc/fsl/dpio/dpio-service.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/soc/fsl/dpio/dpio-service.c b/drivers/soc/fsl/dpio/dpio-service.c
index 7351f30..340c090 100644
--- a/drivers/soc/fsl/dpio/dpio-service.c
+++ b/drivers/soc/fsl/dpio/dpio-service.c
@@ -76,8 +76,7 @@ static inline struct dpaa2_io *service_select(struct dpaa2_io *d)
 
 	spin_lock(&dpio_list_lock);
 	d = list_entry(dpio_list.next, struct dpaa2_io, node);
-	list_del(&d->node);
-	list_add_tail(&d->node, &dpio_list);
+	list_move_tail(&d->node, &dpio_list);
 	spin_unlock(&dpio_list_lock);
 
 	return d;
-- 
2.6.2



More information about the Linuxppc-dev mailing list