aboutsummaryrefslogtreecommitdiffstats
path: root/lib/vsprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r--lib/vsprintf.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 8ca29bc0d786..12b71a4d4613 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1520,6 +1520,17 @@ char *escaped_string(char *buf, char *end, u8 *addr, struct printf_spec spec,
1520 return buf; 1520 return buf;
1521} 1521}
1522 1522
1523static char *va_format(char *buf, char *end, struct va_format *va_fmt)
1524{
1525 va_list va;
1526
1527 va_copy(va, *va_fmt->va);
1528 buf += vsnprintf(buf, end > buf ? end - buf : 0, va_fmt->fmt, va);
1529 va_end(va);
1530
1531 return buf;
1532}
1533
1523static noinline_for_stack 1534static noinline_for_stack
1524char *uuid_string(char *buf, char *end, const u8 *addr, 1535char *uuid_string(char *buf, char *end, const u8 *addr,
1525 struct printf_spec spec, const char *fmt) 1536 struct printf_spec spec, const char *fmt)
@@ -2046,15 +2057,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
2046 case 'U': 2057 case 'U':
2047 return uuid_string(buf, end, ptr, spec, fmt); 2058 return uuid_string(buf, end, ptr, spec, fmt);
2048 case 'V': 2059 case 'V':
2049 { 2060 return va_format(buf, end, ptr);
2050 va_list va;
2051
2052 va_copy(va, *((struct va_format *)ptr)->va);
2053 buf += vsnprintf(buf, end > buf ? end - buf : 0,
2054 ((struct va_format *)ptr)->fmt, va);
2055 va_end(va);
2056 return buf;
2057 }
2058 case 'K': 2061 case 'K':
2059 return restricted_pointer(buf, end, ptr, spec); 2062 return restricted_pointer(buf, end, ptr, spec);
2060 case 'N': 2063 case 'N':