* [PATCH v1 1/1] kstrtox: Consistently use _tolower()
@ 2023-08-17 14:59 Andy Shevchenko
0 siblings, 0 replies; only message in thread
From: Andy Shevchenko @ 2023-08-17 14:59 UTC (permalink / raw)
To: Andy Shevchenko, linux-kernel; +Cc: Rasmus Villemoes, Andrew Morton
We already use _tolower() in other places, so convert the one
which open codes it.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
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(-)
diff --git a/lib/kstrtox.c b/lib/kstrtox.c
index 08c14019841a..d586e6af5e5a 100644
--- a/lib/kstrtox.c
+++ b/lib/kstrtox.c
@@ -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')
--
2.40.0.1.gaa8946217a0b
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-08-17 15:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-17 14:59 [PATCH v1 1/1] kstrtox: Consistently use _tolower() Andy Shevchenko
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®