When converting more caller sites, the inline decision will be left up to gcc.
It decreases code size:
text data bss dec hex filename
15710 0 8 15718 3d66 vsprintf.o (ex lib/lib.a-BEFORE)
15534 0 8 15542 3cb6 vsprintf.o (ex lib/lib.a-AFTER)
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
#endif /* CONFIG_BINARY_PRINTF */
#endif /* CONFIG_BINARY_PRINTF */
+static noinline char *skip_space(const char *str)
+{
+ while (isspace(*str))
+ ++str;
+ return (char *)str;
+}
+
/**
* vsscanf - Unformat a buffer into a list of arguments
* @buf: input buffer
/**
* vsscanf - Unformat a buffer into a list of arguments
* @buf: input buffer
* white space, including none, in the input.
*/
if (isspace(*fmt)) {
* white space, including none, in the input.
*/
if (isspace(*fmt)) {
- while (isspace(*fmt))
- ++fmt;
- while (isspace(*str))
- ++str;
+ fmt = skip_space(fmt);
+ str = skip_space(str);
}
/* anything that is not a conversion must match exactly */
}
/* anything that is not a conversion must match exactly */
if (field_width == -1)
field_width = INT_MAX;
/* first, skip leading white space in buffer */
if (field_width == -1)
field_width = INT_MAX;
/* first, skip leading white space in buffer */
- while (isspace(*str))
- str++;
/* now copy until next white space */
while (*str && !isspace(*str) && field_width--)
/* now copy until next white space */
while (*str && !isspace(*str) && field_width--)
/* have some sort of integer conversion.
* first, skip white space in buffer.
*/
/* have some sort of integer conversion.
* first, skip white space in buffer.
*/
- while (isspace(*str))
- str++;
digit = *str;
if (is_sign && digit == '-')
digit = *str;
if (is_sign && digit == '-')