]> www.infradead.org Git - users/willy/linux.git/commitdiff
printf: Convert dentry_name to printf_char
authorMatthew Wilcox <willy@infradead.org>
Wed, 19 Dec 2018 21:03:50 +0000 (16:03 -0500)
committerMatthew Wilcox <willy@infradead.org>
Thu, 20 Dec 2018 04:01:06 +0000 (23:01 -0500)
Signed-off-by: Matthew Wilcox <willy@infradead.org>
lib/vsprintf.c

index ceab03dd297fce2c5b842bcf157149c633ef5674..700d48d5acf6384dc49c903cec829c79c3ed41b2 100644 (file)
@@ -756,7 +756,7 @@ char *dentry_name(struct printf_state *ps, const struct dentry *d)
                }
        }
        s = array[--i];
-       for (n = 0; n != ps->spec.precision; n++, ps->buf++) {
+       for (n = 0; n != ps->spec.precision; n++) {
                char c = *s++;
                if (!c) {
                        if (!i)
@@ -764,8 +764,7 @@ char *dentry_name(struct printf_state *ps, const struct dentry *d)
                        c = '/';
                        s = array[--i];
                }
-               if (ps->buf < ps->end)
-                       *ps->buf = c;
+               printf_char(ps, c);
        }
        rcu_read_unlock();
        printf_widen_string(ps, n);