]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bcachefs: print_string_as_lines: fix extra newline
authorKent Overstreet <kent.overstreet@linux.dev>
Wed, 26 Mar 2025 15:57:03 +0000 (11:57 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Fri, 28 Mar 2025 16:36:32 +0000 (12:36 -0400)
Don't print a newline on empty string; this was causing us to also print
an extra newline when we got to the end of th string.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/util.c

index 553de8d8e3e5eebb7537c82986b77e65669eb6dd..87af551692f44f946f7543a17ac80eb6521b79ab 100644 (file)
@@ -270,7 +270,7 @@ static void __bch2_print_string_as_lines(const char *prefix, const char *lines,
                locked = console_trylock();
        }
 
-       while (1) {
+       while (*lines) {
                p = strchrnul(lines, '\n');
                printk("%s%.*s\n", prefix, (int) (p - lines), lines);
                if (!*p)