[PATCH] lib: kstrtox: Use isdigit() in _parse_integer_limit()

From: Thorsten Blum

Date: Tue Oct 13 2026 - 03:24:51 EST


Use isdigit() to replace the open-coded implementation.

Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
---
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;