From 538227523d3ce23b5f37d37440e09bf1558d6004 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Thu, 20 Dec 2018 09:14:41 -0500 Subject: [PATCH] printf: Convert uuid_string to printf_state Signed-off-by: Matthew Wilcox --- lib/vsprintf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; -- 2.50.1