aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/bcachefs/util.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-03-26 11:57:03 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-03-28 12:36:32 -0400
commit35a11506a341cca48900570f68abdaefc9b84646 (patch)
tree2ab41d247ec9f392f07e34022737035266f1c404 /fs/bcachefs/util.c
parentbcachefs: Fix WARN() in bch2_bkey_pick_read_device() (diff)
downloadwireguard-linux-35a11506a341cca48900570f68abdaefc9b84646.tar.xz
wireguard-linux-35a11506a341cca48900570f68abdaefc9b84646.zip
bcachefs: print_string_as_lines: fix extra newline
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>
Diffstat (limited to '')
-rw-r--r--fs/bcachefs/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c
index 553de8d8e3e5..87af551692f4 100644
--- a/fs/bcachefs/util.c
+++ b/fs/bcachefs/util.c
@@ -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)