Skip to contentSkip to conversation

kstrtox: Consistently use _tolower()

PATCH Applied Andy Shevchenko 1 participant 1 message Aug 17, 2023 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kstrtox: Consistently use _tolower()

We already use _tolower() in other places, so convert the one which open codes it.

---

Note, there is a desire to use hex_to_bin() instead all that stuff. BUT. On x96_64 it gets +15 bytes to the code, which seems due to exported function in use. Dunno if it makes sense to have hex_to_bin() actually be static inline (since it doesn't use ctype.h anymore). Anyway, this may be a material for another patch.

 lib/kstrtox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/kstrtox.c +1 -1
index 08c14019841a..d586e6af5e5a 100644
@@ -59,7 +59,7 @@ unsigned int _parse_integer_limit(const char *s, unsigned int base, unsigned lon
 	rv = 0;
 	while (max_chars--) {
 		unsigned int c = *s;
-		unsigned int lc = c | 0x20; /* don't tolower() this line */
+		unsigned int lc = _tolower(c);
 		unsigned int val;
 
 		if ('0' <= c && c <= '9')
Signature · 1 line
2.40.0.1.gaa8946217a0b