diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-01-24 18:14:40 +0200 |
---|---|---|
committer | Daniel Thompson <daniel.thompson@linaro.org> | 2020-01-31 17:34:54 +0000 |
commit | dc2c733e65848b1df8d55c83eea79fc4a868c800 (patch) | |
tree | 3763be4b32f126c8a9975f912d6eb191ea316b17 /kernel/debug | |
parent | a4f8a7fb1963bc02fbd40a0a28e128bb56d2fcc9 (diff) | |
download | linux-dc2c733e65848b1df8d55c83eea79fc4a868c800.tar.gz linux-dc2c733e65848b1df8d55c83eea79fc4a868c800.tar.bz2 linux-dc2c733e65848b1df8d55c83eea79fc4a868c800.zip |
kdb: Use for_each_console() helper
Replace open coded single-linked list iteration loop with for_each_console()
helper in use.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Diffstat (limited to 'kernel/debug')
-rw-r--r-- | kernel/debug/kdb/kdb_io.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c index 8bcdded5d61f..924bc9298a42 100644 --- a/kernel/debug/kdb/kdb_io.c +++ b/kernel/debug/kdb/kdb_io.c @@ -553,7 +553,7 @@ int vkdb_printf(enum kdb_msgsrc src, const char *fmt, va_list ap) int this_cpu, old_cpu; char *cp, *cp2, *cphold = NULL, replaced_byte = ' '; char *moreprompt = "more> "; - struct console *c = console_drivers; + struct console *c; unsigned long uninitialized_var(flags); /* Serialize kdb_printf if multiple cpus try to write at once. @@ -698,10 +698,9 @@ kdb_printit: cp2++; } } - while (c) { + for_each_console(c) { c->write(c, cp, retlen - (cp - kdb_buffer)); touch_nmi_watchdog(); - c = c->next; } } if (logging) { @@ -752,7 +751,6 @@ kdb_printit: moreprompt = "more> "; kdb_input_flush(); - c = console_drivers; if (dbg_io_ops && !dbg_io_ops->is_console) { len = strlen(moreprompt); @@ -762,10 +760,9 @@ kdb_printit: cp++; } } - while (c) { + for_each_console(c) { c->write(c, moreprompt, strlen(moreprompt)); touch_nmi_watchdog(); - c = c->next; } if (logging) |