Skip to contentSkip to conversation

dyndbg: make ddebug_tables list LIFO for add/remove_module

PATCH Superseded Jim Cromie 1 participant 1 message Nov 27, 2019

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Jim Cromie

author maintainer
#0 lore raw

PATCH 16/16 dyndbg: make ddebug_tables list LIFO for add/remove_module

loadable modules are the last in, and are the only modules that could be removed. ddebug_remove_module() searches from head, but ddebug_add_module() uses list_add_tail(). Change it to list_add() for a micro-optimization.

---
 lib/dynamic_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/dynamic_debug.c +1 -1
index 82daf95b8f64..99284e775682 100644
@@ -960,7 +960,7 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n,
 	dt->ddebugs = tab;
 
 	mutex_lock(&ddebug_lock);
-	list_add_tail(&dt->link, &ddebug_tables);
+	list_add(&dt->link, &ddebug_tables);
 	mutex_unlock(&ddebug_lock);
 
 	vpr_info("%u debug prints in module %s\n", n, dt->mod_name);
Signature · 1 line
2.23.0