]> www.infradead.org Git - users/willy/linux.git/commitdiff
printf: Convert resource_string to printf_state
authorMatthew Wilcox <willy@infradead.org>
Sat, 15 Dec 2018 10:58:12 +0000 (05:58 -0500)
committerMatthew Wilcox <willy@infradead.org>
Sat, 15 Dec 2018 10:58:12 +0000 (05:58 -0500)
lib/vsprintf.c

index 0d62ad5093c8f2f86cba0f78ed5a54957367f62a..7d606b4e0c93c01881e9262732285ebb23eb96cc 100644 (file)
@@ -828,8 +828,7 @@ static const struct printf_spec default_dec_spec = {
 };
 
 static noinline_for_stack
-char *resource_string(char *buf, char *end, struct resource *res,
-                     struct printf_spec spec, const char *fmt)
+char *resource_string(struct printf_state *ps, struct resource *res)
 {
 #ifndef IO_RSRC_PRINTK_SIZE
 #define IO_RSRC_PRINTK_SIZE    6
@@ -872,7 +871,7 @@ char *resource_string(char *buf, char *end, struct resource *res,
                     2*RSRC_BUF_SIZE + FLAG_BUF_SIZE + RAW_BUF_SIZE)];
 
        char *p = sym, *pend = sym + sizeof(sym);
-       int decode = (fmt[0] == 'R') ? 1 : 0;
+       int decode = (ps->fmt[0] == 'R') ? 1 : 0;
        const struct printf_spec *specp;
 
        *p++ = '[';
@@ -922,7 +921,8 @@ char *resource_string(char *buf, char *end, struct resource *res,
        *p++ = ']';
        *p = '\0';
 
-       return string(buf, end, sym, spec);
+       printf_string(ps, sym);
+       return ps->buf;
 }
 
 static noinline_for_stack
@@ -1891,7 +1891,7 @@ char *pointer(struct printf_state *ps, void *ptr)
                return symbol_string(ps, ptr);
        case 'R':
        case 'r':
-               return resource_string(buf, end, ptr, spec, fmt);
+               return resource_string(ps, ptr);
        case 'h':
                return hex_string(buf, end, ptr, spec, fmt);
        case 'b':