]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - lib/kstrtox.c
Merge tag 'sunxi-fixes-for-4.13-3' of https://git.kernel.org/pub/scm/linux/kernel...
[mirror_ubuntu-artful-kernel.git] / lib / kstrtox.c
index 90013f4841c77b35935009d313363e2e7b02c0d7..720144075c1ea06b659ab7a15512ca6b3a1bba24 100644 (file)
@@ -52,12 +52,14 @@ unsigned int _parse_integer(const char *s, unsigned int base, unsigned long long
        res = 0;
        rv = 0;
        while (1) {
+               unsigned int c = *s;
+               unsigned int lc = c | 0x20; /* don't tolower() this line */
                unsigned int val;
 
-               if ('0' <= *s && *s <= '9')
-                       val = *s - '0';
-               else if ('a' <= _tolower(*s) && _tolower(*s) <= 'f')
-                       val = _tolower(*s) - 'a' + 10;
+               if ('0' <= c && c <= '9')
+                       val = c - '0';
+               else if ('a' <= lc && lc <= 'f')
+                       val = lc - 'a' + 10;
                else
                        break;