The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: Thorsten Blum <blum@kernel.org>
Cc: Johan Hovold <johan@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB: serial: console: use isdigit() in usb_console_setup()
Date: Fri, 27 Nov 2026 21:23:49 +0000	[thread overview]
Message-ID: <20261127212349.1b393b5b@pumpkin> (raw)
In-Reply-To: <20261106090304.2410-2-blum@kernel.org>

On Fri,  6 Nov 2026 10:03:05 +0100
Thorsten Blum <blum@kernel.org> wrote:

> Use isdigit() to replace the open-coded implementation.
> 
> Signed-off-by: Thorsten Blum <blum@kernel.org>
> ---
>  drivers/usb/serial/console.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
> index 29f09190846e..25ea57c8fd3f 100644
> --- a/drivers/usb/serial/console.c
> +++ b/drivers/usb/serial/console.c
> @@ -15,6 +15,7 @@
>  #include <linux/slab.h>
>  #include <linux/tty.h>
>  #include <linux/console.h>
> +#include <linux/ctype.h>
>  #include <linux/serial.h>
>  #include <linux/usb.h>
>  #include <linux/usb/serial.h>
> @@ -70,7 +71,7 @@ static int usb_console_setup(struct console *co, char *options)
>  	if (options) {
>  		baud = simple_strtoul(options, NULL, 10);
>  		s = options;
> -		while (*s >= '0' && *s <= '9')
> +		while (isdigit(*s))
>  			s++;

What was wrong with:
		baud + simple_strtoul(options, &s, 10);
Seems to do just what was wanted.

David

>  		if (*s)
>  			parity = *s++;
> 


      parent reply	other threads:[~2026-11-27 21:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06  9:03 [PATCH] USB: serial: console: use isdigit() in usb_console_setup() Thorsten Blum
2026-11-27  9:55 ` Johan Hovold
2026-11-27 21:23 ` David Laight [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261127212349.1b393b5b@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=blum@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox