* [PATCH] lib: kstrtox: Use isdigit() in _parse_integer_limit()
@ 2026-10-13 7:21 Thorsten Blum
0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-10-13 7:21 UTC (permalink / raw)
To: Andrew Morton; +Cc: Thorsten Blum, linux-kernel
Use isdigit() to replace the open-coded implementation.
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
lib/kstrtox.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/kstrtox.c b/lib/kstrtox.c
index bac1c057e1b0..1b3f0d3fff37 100644
--- a/lib/kstrtox.c
+++ b/lib/kstrtox.c
@@ -69,7 +69,7 @@ unsigned int _parse_integer_limit(const char *s, unsigned int base, unsigned lon
unsigned int lc = _tolower(c);
unsigned int val;
- if ('0' <= c && c <= '9')
+ if (isdigit(c))
val = c - '0';
else if ('a' <= lc && lc <= 'f')
val = lc - 'a' + 10;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-13 7:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-13 7:21 [PATCH] lib: kstrtox: Use isdigit() in _parse_integer_limit() Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®