linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] kgdboc: Use for_each_console() helper
@ 2020-01-24 16:11 Andy Shevchenko
  2020-01-31 17:01 ` Daniel Thompson
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2020-01-24 16:11 UTC (permalink / raw)
  To: Jason Wessel, Daniel Thompson, kgdb-bugreport, Douglas Anderson,
	linux-serial, Greg Kroah-Hartman
  Cc: Andy Shevchenko

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>
---
 drivers/tty/serial/kgdboc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
index c7d51b51898f..c9f94fa82be4 100644
--- a/drivers/tty/serial/kgdboc.c
+++ b/drivers/tty/serial/kgdboc.c
@@ -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;
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] kgdboc: Use for_each_console() helper
  2020-01-24 16:11 [PATCH v1] kgdboc: Use for_each_console() helper Andy Shevchenko
@ 2020-01-31 17:01 ` Daniel Thompson
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Thompson @ 2020-01-31 17:01 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jason Wessel, kgdb-bugreport, Douglas Anderson, linux-serial,
	Greg Kroah-Hartman

On Fri, Jan 24, 2020 at 06:11:32PM +0200, Andy Shevchenko wrote:
> 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>

> ---
>  drivers/tty/serial/kgdboc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
> index c7d51b51898f..c9f94fa82be4 100644
> --- a/drivers/tty/serial/kgdboc.c
> +++ b/drivers/tty/serial/kgdboc.c
> @@ -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;
> -- 
> 2.24.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-31 17:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-24 16:11 [PATCH v1] kgdboc: Use for_each_console() helper Andy Shevchenko
2020-01-31 17:01 ` Daniel Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).