[PATCH 2/2] dyndbg: clean up dynamic_debug_init() to improve readability
From: Yuntao Wang
Date: Tue Aug 11 2026 - 08:24:28 EST
Keep variable assignments in the same order throughout the function to
make the code easier to follow.
No functional changes.
Signed-off-by: Yuntao Wang <yuntao.wang@xxxxxxxxx>
---
lib/dynamic_debug.c | 15 ++++++++-------
1 file 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),
--
2.55.0