diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-03-21 18:05:39 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:28 -0400 |
commit | 3756111d138b6c5983d0c7cc2de12a7ec3d1e3d4 (patch) | |
tree | b0e046a9585e205d8b266c70b2ffb6c2bd182ead /fs/bcachefs/util.h | |
parent | b8559f1a212a7035b430b83e0a01e94a872adc23 (diff) | |
download | linux-3756111d138b6c5983d0c7cc2de12a7ec3d1e3d4.tar.gz linux-3756111d138b6c5983d0c7cc2de12a7ec3d1e3d4.tar.bz2 linux-3756111d138b6c5983d0c7cc2de12a7ec3d1e3d4.zip |
bcachefs: Add printf format attribute to bch2_pr_buf()
This tells the compiler to check printf format strings, and catches a
few bugs.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/util.h')
-rw-r--r-- | fs/bcachefs/util.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h index 465ba030133b..f2df4d7fbec9 100644 --- a/fs/bcachefs/util.h +++ b/fs/bcachefs/util.h @@ -282,7 +282,8 @@ static inline size_t printbuf_linelen(struct printbuf *buf) return buf->pos - buf->last_newline; } -void bch2_pr_buf(struct printbuf *out, const char *fmt, ...); +void bch2_pr_buf(struct printbuf *out, const char *fmt, ...) + __attribute__ ((format (printf, 2, 3))); #define pr_buf(_out, ...) bch2_pr_buf(_out, __VA_ARGS__) |