fs/bcachefs/error.h:168:9: warning: function 'bch2_bkey_fsck_err' might be a candidate for 'gnu_printf' format attribute

From: kernel test robot
Date: Fri Dec 08 2023 - 22:56:05 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5e3f5b81de80c98338bcb47c233aebefee5a4801
commit: b65db750e2bb9252321fd54c284edd73c1595a09 bcachefs: Enumerate fsck errors
date: 5 weeks ago
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20231209/202312091128.LxOCXRoz-lkp@xxxxxxxxx/config)
compiler: s390-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231209/202312091128.LxOCXRoz-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312091128.LxOCXRoz-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

In file included from fs/bcachefs/bcachefs.h:206,
from fs/bcachefs/acl.c:3:
fs/bcachefs/bcachefs_format.h:215:25: warning: 'p' offset 3 in 'struct bkey' isn't aligned to 4 [-Wpacked-not-aligned]
215 | struct bpos p;
| ^
fs/bcachefs/bcachefs_format.h:217:25: warning: 'version' offset 27 in 'struct bkey' isn't aligned to 4 [-Wpacked-not-aligned]
217 | struct bversion version;
| ^~~~~~~
In file included from fs/bcachefs/str_hash.h:8,
from fs/bcachefs/xattr.h:5,
from fs/bcachefs/acl.c:6:
fs/bcachefs/error.h: In function 'bch2_bkey_fsck_err':
>> fs/bcachefs/error.h:168:9: warning: function 'bch2_bkey_fsck_err' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
168 | prt_vprintf(err_msg, fmt, args);
| ^~~~~~~~~~~


vim +168 fs/bcachefs/error.h

138
139 #define __fsck_err_on(cond, c, _flags, _err_type, ...) \
140 (unlikely(cond) ? __fsck_err(c, _flags, _err_type, __VA_ARGS__) : false)
141
142 #define need_fsck_err_on(cond, c, _err_type, ...) \
143 __fsck_err_on(cond, c, FSCK_CAN_IGNORE|FSCK_NEED_FSCK, _err_type, __VA_ARGS__)
144
145 #define need_fsck_err(c, _err_type, ...) \
146 __fsck_err(c, FSCK_CAN_IGNORE|FSCK_NEED_FSCK, _err_type, __VA_ARGS__)
147
148 #define mustfix_fsck_err(c, _err_type, ...) \
149 __fsck_err(c, FSCK_CAN_FIX, _err_type, __VA_ARGS__)
150
151 #define mustfix_fsck_err_on(cond, c, _err_type, ...) \
152 __fsck_err_on(cond, c, FSCK_CAN_FIX, _err_type, __VA_ARGS__)
153
154 #define fsck_err(c, _err_type, ...) \
155 __fsck_err(c, FSCK_CAN_FIX|FSCK_CAN_IGNORE, _err_type, __VA_ARGS__)
156
157 #define fsck_err_on(cond, c, _err_type, ...) \
158 __fsck_err_on(cond, c, FSCK_CAN_FIX|FSCK_CAN_IGNORE, _err_type, __VA_ARGS__)
159
160 static inline void bch2_bkey_fsck_err(struct bch_fs *c,
161 struct printbuf *err_msg,
162 enum bch_sb_error_id err_type,
163 const char *fmt, ...)
164 {
165 va_list args;
166
167 va_start(args, fmt);
> 168 prt_vprintf(err_msg, fmt, args);
169 va_end(args);
170

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki