Skip to content

Commit

Permalink
dyndbg: make ddebug_tables list LIFO for add/remove_module
Browse files Browse the repository at this point in the history
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: <jbaron@akamai.com>
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Link: https://lore.kernel.org/r/20200719231058.1586423-11-jim.cromie@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jim Cromie authored and Greg Kroah-Hartman committed Jul 24, 2020
1 parent 9c9d0ac commit 47e9f5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dynamic_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 47e9f5a

Please sign in to comment.