From e60b8f7a1d050d5400684f270faf773a1b27e085 Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Tue, 13 Oct 2026 09:21:10 +0200 Subject: [PATCH] lib: kstrtox: use isdigit() in _parse_integer_limit() Use isdigit() to replace the open-coded implementation. Link: https://lore.kernel.org/20261013072108.4407-3-blum@kernel.org Signed-off-by: Thorsten Blum Signed-off-by: Andrew Morton Reviewed-by: Andrew Morton --- 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;