* [PATCH] USB: serial: console: use isdigit() in usb_console_setup()
@ 2026-11-06 9:03 Thorsten Blum
2026-11-06 9:05 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-11-06 9:03 UTC (permalink / raw)
To: Johan Hovold, Greg Kroah-Hartman; +Cc: Thorsten Blum, linux-usb, linux-kernel
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++;
if (*s)
parity = *s++;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-06 9:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-06 9:03 [PATCH] USB: serial: console: use isdigit() in usb_console_setup() Thorsten Blum
2026-11-06 9:05 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox