]> www.infradead.org Git - users/willy/linux.git/commitdiff
printf: Convert uuid_string to printf_state
authorMatthew Wilcox <willy@infradead.org>
Thu, 20 Dec 2018 14:14:41 +0000 (09:14 -0500)
committerMatthew Wilcox <willy@infradead.org>
Thu, 20 Dec 2018 14:14:41 +0000 (09:14 -0500)
Signed-off-by: Matthew Wilcox <willy@infradead.org>
lib/vsprintf.c

index 6103e7a89857cd06109b991fb17179232022772e..2f4b6decc1c20ebbd563e9cc3856a0a307ecf49f 100644 (file)
@@ -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;