mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
lib/vsprintf.c: replace while with do-while in skip_atoi
All callers of skip_atoi have already checked for the first character being a digit. In this case, gcc generates simpler code for a do while-loop. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
2aa2f9e21e
commit
43e5b666cf
@ -114,8 +114,9 @@ int skip_atoi(const char **s)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
while (isdigit(**s))
|
||||
do {
|
||||
i = i*10 + *((*s)++) - '0';
|
||||
} while (isdigit(**s));
|
||||
|
||||
return i;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user