summaryrefslogtreecommitdiff
path: root/fs/bcachefs/util.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-03-22 01:05:39 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:28 +0300
commit3756111d138b6c5983d0c7cc2de12a7ec3d1e3d4 (patch)
treeb0e046a9585e205d8b266c70b2ffb6c2bd182ead /fs/bcachefs/util.h
parentb8559f1a212a7035b430b83e0a01e94a872adc23 (diff)
downloadlinux-3756111d138b6c5983d0c7cc2de12a7ec3d1e3d4.tar.xz
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.h3
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__)