Skip to contentSkip to conversation

ftrace: Use list_move instead of list_del/list_add

PATCH New Baokun Li 1 participant 1 message Jun 8, 2021

Subsystems (3)
lore
Share & tools
lore

Baokun Li

author
#0 lore raw

PATCH 1/1 ftrace: Use list_move instead of list_del/list_add

Using list_move() instead of list_del() + list_add().

---
 kernel/trace/ftrace.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/trace/ftrace.c +1 -2
index 2e8a3fde7104..2c0374056637 100644
@@ -4206,8 +4206,7 @@ static void process_mod_list(struct list_head *head, struct ftrace_ops *ops,
 		if (!func) /* warn? */
 			continue;
 
-		list_del(&ftrace_mod->list);
-		list_add(&ftrace_mod->list, &process_mods);
+		list_move(&ftrace_mod->list, &process_mods);
 
 		/* Use the newly allocated func, as it may be "*" */
 		kfree(ftrace_mod->func);