VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Alexey Dobriyan <adobriyan@gmail.com> 2017-07-10 15:51:41 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2017-07-10 16:32:34 -0700 commit: be5f3c7774a158c5bd08de22d54b0612f954dfa8 parent: 512750ef8b06290a55d749239f956f9c21d7daca
Commit Summary:
lib/kstrtox.c: use "unsigned int" more
Diffstat:
1 file changed, 6 insertions, 4 deletions
diff --git a/lib/kstrtox.c b/lib/kstrtox.c
index 90013f4841c7..720144075c1e 100644
--- a/lib/kstrtox.c
+++ b/lib/kstrtox.c
@@ -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;