diff options
author | Bart Van Assche <bart.vanassche@wdc.com> | 2018-03-18 20:36:27 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-03-18 22:15:20 -0400 |
commit | 4a4e443835a43a79113cc237c472c0d268eb1e1c (patch) | |
tree | f25c107a61eed11222f60863ba3b3fec1fdc56b4 | |
parent | fd01991d5c20098c5c1ffc4dca6c821cc60a2f74 (diff) |
bcache: Add __printf annotation to __bch_check_keys()
Make it possible for the compiler to verify the consistency of the
format string passed to __bch_check_keys() and the arguments that
should be formatted according to that format string.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Michael Lyle <mlyle@lyle.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/md/bcache/bset.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/bcache/bset.h b/drivers/md/bcache/bset.h index fa506c1aa524..0c24280f3b98 100644 --- a/drivers/md/bcache/bset.h +++ b/drivers/md/bcache/bset.h | |||
@@ -531,14 +531,15 @@ int __bch_keylist_realloc(struct keylist *, unsigned); | |||
531 | #ifdef CONFIG_BCACHE_DEBUG | 531 | #ifdef CONFIG_BCACHE_DEBUG |
532 | 532 | ||
533 | int __bch_count_data(struct btree_keys *); | 533 | int __bch_count_data(struct btree_keys *); |
534 | void __bch_check_keys(struct btree_keys *, const char *, ...); | 534 | void __printf(2, 3) __bch_check_keys(struct btree_keys *, const char *, ...); |
535 | void bch_dump_bset(struct btree_keys *, struct bset *, unsigned); | 535 | void bch_dump_bset(struct btree_keys *, struct bset *, unsigned); |
536 | void bch_dump_bucket(struct btree_keys *); | 536 | void bch_dump_bucket(struct btree_keys *); |
537 | 537 | ||
538 | #else | 538 | #else |
539 | 539 | ||
540 | static inline int __bch_count_data(struct btree_keys *b) { return -1; } | 540 | static inline int __bch_count_data(struct btree_keys *b) { return -1; } |
541 | static inline void __bch_check_keys(struct btree_keys *b, const char *fmt, ...) {} | 541 | static inline void __printf(2, 3) |
542 | __bch_check_keys(struct btree_keys *b, const char *fmt, ...) {} | ||
542 | static inline void bch_dump_bucket(struct btree_keys *b) {} | 543 | static inline void bch_dump_bucket(struct btree_keys *b) {} |
543 | void bch_dump_bset(struct btree_keys *, struct bset *, unsigned); | 544 | void bch_dump_bset(struct btree_keys *, struct bset *, unsigned); |
544 | 545 | ||