lkml.org 
[lkml]   [2020]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 07/16] dyndbg: make ddebug_tables list LIFO for add/remove_module
    Date
    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.

    Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
    ---
    lib/dynamic_debug.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
    index 08b8c9c04a17..494856c04fa7 100644
    --- a/lib/dynamic_debug.c
    +++ b/lib/dynamic_debug.c
    @@ -896,7 +896,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);
    --
    2.26.2
    \
     
     \ /
      Last update: 2020-06-05 18:28    [W:3.888 / U:2.356 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site