Skip to content

Commit

Permalink
dyndbg: unwrap __ddebug_add_module inner function NOTYET
Browse files Browse the repository at this point in the history
The inner func has a base arg which is unused in the body, so theres
no point in having the inner fn.

Its one-time purpose was to expose a wider interface to the internal
caller: dynamic_debug_init(), to allow communicating each module's
offset in the builtin _ddebug[] table.

That purpose was obsoleted by cited commit, when ddebug_add_module()
was converted to pass a *ddebug_info, which is used as a cursor by the
caller.

TODO: the cited commit gives another reason for base, to provide an
index in support of de-duplicating column data.  Refresh that patchset
to see if its still true.

Fixes: b7b4eeb ("dyndbg: gather __dyndbg[] state into struct _ddebug_info")
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
  • Loading branch information
jimc committed Jan 11, 2023
1 parent 4ef021a commit 33d18f4
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/dynamic_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1348,8 +1348,7 @@ static void ddebug_attach_client_module_classes(struct ddebug_table *dt, const s
* Allocate a new ddebug_table for the given module
* and add it to the global list.
*/
static int __ddebug_add_module(struct _ddebug_info *di, unsigned int base,
const char *modname)
int ddebug_add_module(struct _ddebug_info *di, const char *modname)
{
struct ddebug_table *dt;

Expand Down Expand Up @@ -1391,11 +1390,6 @@ static int __ddebug_add_module(struct _ddebug_info *di, unsigned int base,
return 0;
}

int ddebug_add_module(struct _ddebug_info *di, const char *modname)
{
return __ddebug_add_module(di, 0, modname);
}

/* helper for ddebug_dyndbg_(boot|module)_param_cb */
static int ddebug_dyndbg_param_cb(char *param, char *val,
const char *modname, int on_err)
Expand Down Expand Up @@ -1538,7 +1532,7 @@ static int __init dynamic_debug_init(void)
mod_ct++;
di.num_descs = mod_sites;
di.descs = iter_mod_start;
ret = __ddebug_add_module(&di, i - mod_sites, modname);
ret = ddebug_add_module(&di, modname);
if (ret)
goto out_err;

Expand All @@ -1549,7 +1543,7 @@ static int __init dynamic_debug_init(void)
}
di.num_descs = mod_sites;
di.descs = iter_mod_start;
ret = __ddebug_add_module(&di, i - mod_sites, modname);
ret = ddebug_add_module(&di, modname);
if (ret)
goto out_err;

Expand Down

0 comments on commit 33d18f4

Please sign in to comment.