]> www.infradead.org Git - users/willy/linux.git/commitdiff
printf: Convert pointer() to take a printf_state
authorMatthew Wilcox <willy@infradead.org>
Wed, 12 Dec 2018 18:46:09 +0000 (13:46 -0500)
committerMatthew Wilcox <willy@infradead.org>
Wed, 12 Dec 2018 18:46:09 +0000 (13:46 -0500)
Signed-off-by: Matthew Wilcox <willy@infradead.org>
lib/vsprintf.c

index 277b02c5141b20d2fe6bbd08d9589d73905b4c3a..7d61376ae6ee9856cbc96b9e51024c61de2c66dc 100644 (file)
@@ -1857,9 +1857,13 @@ char *device_node_string(char *buf, char *end, struct device_node *dn,
  * rendering it useful as a unique identifier.
  */
 static noinline_for_stack
-char *pointer(const char *fmt, char *buf, char *end, void *ptr,
-             struct printf_spec spec)
+char *pointer(struct printf_state *ps, void *ptr)
 {
+       char *buf = ps->buf;
+       char *end = ps->end;
+       const char *fmt = ps->fmt;
+       struct printf_spec spec = ps->spec;
+
        const int default_width = 2 * sizeof(void *);
 
        if (!ptr && *fmt != 'K' && *fmt != 'x') {
@@ -1982,7 +1986,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
 
 void printf_pointer(struct printf_state *ps, void *ptr)
 {
-       ps->buf = pointer(ps->fmt, ps->buf, ps->end, ptr, ps->spec);
+       ps->buf = pointer(ps, ptr);
 }
 
 /*