Skip to content

Commit

Permalink
kgdboc: Use for_each_console() helper
Browse files Browse the repository at this point in the history
Replace open coded single-linked list iteration loop with for_each_console()
helper in use.

Signed-off-by: Andy Shevchenko <[email protected]>
Acked-by: Daniel Thompson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
andy-shev authored and gregkh committed Feb 10, 2020
1 parent bb6d3fb commit 8e217b0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/tty/serial/kgdboc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8e217b0

Please sign in to comment.