[PATCH 1/2] serial: core: Use isdigit() in uart_parse_options()
From: Thorsten Blum
Date: Wed Oct 14 2026 - 10:38:37 EST
Use isdigit() to replace the open-coded implementation.
Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
---
drivers/tty/serial/serial_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 6332ed545c89..6509f65dec36 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -14,6 +14,7 @@
#include <linux/sched/signal.h>
#include <linux/init.h>
#include <linux/console.h>
+#include <linux/ctype.h>
#include <linux/gpio/consumer.h>
#include <linux/kernel.h>
#include <linux/of.h>
@@ -2211,7 +2212,7 @@ uart_parse_options(const char *options, int *baud, int *parity,
const char *s = options;
*baud = simple_strtoul(s, NULL, 10);
- while (*s >= '0' && *s <= '9')
+ while (isdigit(*s))
s++;
if (*s)
*parity = *s++;