summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/checksum.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-04-12 15:17:00 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-04-13 22:48:17 -0400
commit9abb6dd7ce5a261f7aebf6f396b50a63db71133f (patch)
tree81d697fe0dd172159d9da17c6f69a494681e6f93 /fs/bcachefs/checksum.h
parentba8ed36e72033dd6b89d44145f323e6c4508bfc9 (diff)
downloadlinux-stable-9abb6dd7ce5a261f7aebf6f396b50a63db71133f.tar.gz
linux-stable-9abb6dd7ce5a261f7aebf6f396b50a63db71133f.tar.bz2
linux-stable-9abb6dd7ce5a261f7aebf6f396b50a63db71133f.zip
bcachefs: Standardize helpers for printing enum strs with bounds checks
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/checksum.h')
-rw-r--r--fs/bcachefs/checksum.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/bcachefs/checksum.h b/fs/bcachefs/checksum.h
index 1b8c2c1016dc..e40499fde9a4 100644
--- a/fs/bcachefs/checksum.h
+++ b/fs/bcachefs/checksum.h
@@ -61,11 +61,12 @@ static inline void bch2_csum_err_msg(struct printbuf *out,
struct bch_csum expected,
struct bch_csum got)
{
- prt_printf(out, "checksum error: got ");
+ prt_str(out, "checksum error, type ");
+ bch2_prt_csum_type(out, type);
+ prt_str(out, ": got ");
bch2_csum_to_text(out, type, got);
prt_str(out, " should be ");
bch2_csum_to_text(out, type, expected);
- prt_printf(out, " type %s", bch2_csum_types[type]);
}
int bch2_chacha_encrypt_key(struct bch_key *, struct nonce, void *, size_t);