From: Jim Cromie Date: Sun, 19 Jul 2020 23:10:50 +0000 (-0600) Subject: dyndbg: make ddebug_tables list LIFO for add/remove_module X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=47e9f5a82329696b31e7e0672653954f6e9b0f54;p=linux.git dyndbg: make ddebug_tables list LIFO for add/remove_module loadable modules are the last in on this list, 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. Acked-by: Signed-off-by: Jim Cromie Link: https://lore.kernel.org/r/20200719231058.1586423-11-jim.cromie@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index da3ed54a65211..e879af4e66e0d 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -895,7 +895,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); v2pr_info("%u debug prints in module %s\n", n, dt->mod_name);