Linux-Serial Archive on lore.kernel.org
 help / color / 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	[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, back to index

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

Linux-Serial Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-serial/0 linux-serial/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-serial linux-serial/ https://lore.kernel.org/linux-serial \
		linux-serial@vger.kernel.org
	public-inbox-index linux-serial

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-serial


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git