diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-12 22:17:00 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-14 05:48:17 +0300 |
commit | 9abb6dd7ce5a261f7aebf6f396b50a63db71133f (patch) | |
tree | 81d697fe0dd172159d9da17c6f69a494681e6f93 /fs/bcachefs/checksum.h | |
parent | ba8ed36e72033dd6b89d44145f323e6c4508bfc9 (diff) | |
download | linux-9abb6dd7ce5a261f7aebf6f396b50a63db71133f.tar.xz |
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.h | 5 |
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); |