diff options
| author | Nathan Chancellor <[email protected]> | 2023-09-12 19:15:40 +0000 |
|---|---|---|
| committer | Kent Overstreet <[email protected]> | 2023-10-22 21:10:13 +0000 |
| commit | 14f63ff3f6617902cd54edb468b906214ab00f34 (patch) | |
| tree | 05af7a1a4ce7762b47f0c831bc4d5174b433a10d /fs/bcachefs/btree_trans_commit.c | |
| parent | bcachefs: Fix -Wformat in bch2_btree_key_cache_to_text() (diff) | |
| download | kernel-14f63ff3f6617902cd54edb468b906214ab00f34.tar.gz kernel-14f63ff3f6617902cd54edb468b906214ab00f34.zip | |
bcachefs: Fix -Wformat in bch2_alloc_v4_invalid()
When building bcachefs for 32-bit ARM, there is a compiler warning in
bch2_alloc_v4_invalid() due to use of an incorrect format specifier:
fs/bcachefs/alloc_background.c:246:30: error: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Werror,-Wformat]
245 | prt_printf(err, "bad val size (%u > %lu)",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| %u
246 | alloc_v4_u64s(a.v), bkey_val_u64s(k.k));
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
fs/bcachefs/bkey.h:58:27: note: expanded from macro 'bkey_val_u64s'
58 | #define bkey_val_u64s(_k) ((_k)->u64s - BKEY_U64s)
| ^
fs/bcachefs/util.h:223:54: note: expanded from macro 'prt_printf'
223 | #define prt_printf(_out, ...) bch2_prt_printf(_out, __VA_ARGS__)
| ^~~~~~~~~~~
This expression is of type 'size_t'. On 64-bit architectures, size_t is
'unsigned long', so there is no warning when using %lu but on 32-bit
architectures, size_t is 'unsigned int'. Use '%zu', the format specifier
for 'size_t' to eliminate the warning.
Fixes: 11be8e8db283 ("bcachefs: New on disk format: Backpointers")
Signed-off-by: Nathan Chancellor <[email protected]>
Signed-off-by: Kent Overstreet <[email protected]>
Diffstat (limited to 'fs/bcachefs/btree_trans_commit.c')
0 files changed, 0 insertions, 0 deletions
