diff options
| author | Yuntao Wang <yuntao.wang@linux.dev> | 2026-08-11 20:18:31 +0800 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-10-30 00:14:38 -0700 |
| commit | 459d5effacc891442c348ec64496086aa0dee615 (patch) | |
| tree | d741f3098a4aa03c98bb0086e70c5805098720c8 | |
| parent | 156df25070327a2216f8ab48bcfcf0d9afb06c00 (diff) | |
| download | linux-next-459d5effacc891442c348ec64496086aa0dee615.tar.gz linux-next-459d5effacc891442c348ec64496086aa0dee615.zip | |
dyndbg: clean up dynamic_debug_init() to improve readability
Keep variable assignments in the same order throughout the function to
make the code easier to follow.
No functional changes.
Link: https://lore.kernel.org/20260811121831.577848-3-yuntao.wang@linux.dev
Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Jason Baron <jbaron@akamai.com>
Cc: Jim Cromie <jim.cromie@gmail.com>
| -rw-r--r-- | lib/dynamic_debug.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 16fad5454d6a..49334d1aa4b3 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1442,28 +1442,29 @@ static int __init dynamic_debug_init(void) i = mod_sites = mod_ct = 0; for (; iter < __stop___dyndbg; iter++, i++, mod_sites++) { - if (strcmp(modname, iter->modname)) { - mod_ct++; - di.num_descs = mod_sites; di.descs = iter_mod_start; + di.num_descs = mod_sites; ret = ddebug_add_module(&di, modname); if (ret) goto out_err; - mod_sites = 0; - modname = iter->modname; + mod_ct++; + iter_mod_start = iter; + modname = iter->modname; + mod_sites = 0; } } - mod_ct++; - di.num_descs = mod_sites; di.descs = iter_mod_start; + di.num_descs = mod_sites; ret = ddebug_add_module(&di, modname); if (ret) goto out_err; + mod_ct++; + ddebug_init_success = 1; vpr_info("%d prdebugs in %d modules, %d KiB in ddebug tables, %d kiB in __dyndbg section\n", i, mod_ct, (int)((mod_ct * sizeof(struct ddebug_table)) >> 10), |
