From: Matthew Wilcox Date: Sat, 15 Dec 2018 10:58:12 +0000 (-0500) Subject: printf: Convert resource_string to printf_state X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1b2ef7518a2baba1f4d30f67fe9cad7e69df2668;p=users%2Fwilly%2Flinux.git printf: Convert resource_string to printf_state --- diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 0d62ad5093c8..7d606b4e0c93 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -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':