From: Thorsten Blum <blum@kernel.org>
To: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Hugo Villeneuve" <hvilleneuve@dimonoff.com>,
"Johan Hovold" <johan@kernel.org>,
"Karl Mehltretter" <kmehltretter@gmail.com>,
"John Ogness" <john.ogness@linutronix.de>,
"Uwe Kleine-König (The Capable Hub)"
<u.kleine-koenig@baylibre.com>
Cc: Thorsten Blum <blum@kernel.org>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: [PATCH 1/2] serial: core: Use isdigit() in uart_parse_options()
Date: Wed, 14 Oct 2026 16:30:32 +0200 [thread overview]
Message-ID: <20261014143034.104950-3-blum@kernel.org> (raw)
Use isdigit() to replace the open-coded implementation.
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
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++;
next reply other threads:[~2026-10-14 14:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 14:30 Thorsten Blum [this message]
2026-10-14 14:30 ` [PATCH 2/2] serial: earlycon: Use isdigit() in earlycon_init() Thorsten Blum
2026-10-14 14:34 ` sashiko-bot
2026-10-14 14:35 ` [PATCH 1/2] serial: core: Use isdigit() in uart_parse_options() sashiko-bot
2026-10-14 14:54 ` John Ogness
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=20261014143034.104950-3-blum@kernel.org \
--to=blum@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hvilleneuve@dimonoff.com \
--cc=jirislaby@kernel.org \
--cc=johan@kernel.org \
--cc=john.ogness@linutronix.de \
--cc=kmehltretter@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=u.kleine-koenig@baylibre.com \
/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