From: Matthew Wilcox Date: Thu, 20 Dec 2018 14:14:41 +0000 (-0500) Subject: printf: Convert uuid_string to printf_state X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=538227523d3ce23b5f37d37440e09bf1558d6004;p=users%2Fwilly%2Flinux.git printf: Convert uuid_string to printf_state Signed-off-by: Matthew Wilcox --- diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 6103e7a89857..2f4b6decc1c2 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1417,8 +1417,7 @@ char *escaped_string(char *buf, char *end, u8 *addr, struct printf_spec spec, } static noinline_for_stack -char *uuid_string(char *buf, char *end, const u8 *addr, - struct printf_spec spec, const char *fmt) +char *uuid_string(struct printf_state *ps, const u8 *addr) { char uuid[UUID_STRING_LEN + 1]; char *p = uuid; @@ -1426,7 +1425,7 @@ char *uuid_string(char *buf, char *end, const u8 *addr, const u8 *index = uuid_index; bool uc = false; - switch (*(++fmt)) { + switch (ps->fmt[1]) { case 'L': uc = true; /* fall-through */ case 'l': @@ -1454,7 +1453,8 @@ char *uuid_string(char *buf, char *end, const u8 *addr, *p = 0; - return string(buf, end, uuid, spec); + printf_string(ps, uuid); + return ps->buf; } int kptr_restrict __read_mostly; @@ -1934,7 +1934,7 @@ char *pointer(struct printf_state *ps, void *ptr) case 'E': return escaped_string(buf, end, ptr, spec, fmt); case 'U': - return uuid_string(buf, end, ptr, spec, fmt); + return uuid_string(ps, ptr); case 'V': { va_list va;