kgdboc: 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>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/20200124161132.65519-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Andy Shevchenko 2020-01-24 18:11:32 +02:00 committed by Greg Kroah-Hartman
parent bb6d3fb354
commit 8e217b0781
1 changed files with 1 additions and 3 deletions

View File

@ -169,15 +169,13 @@ static int configure_kgdboc(void)
if (!p)
goto noconfig;
cons = console_drivers;
while (cons) {
for_each_console(cons) {
int idx;
if (cons->device && cons->device(cons, &idx) == p &&
idx == tty_line) {
kgdboc_io_ops.is_console = 1;
break;
}
cons = cons->next;
}
kgdb_tty_driver = p;