Use uint64_t instead of __u64 in the definitions of the endianness conversion macros. This patch fixes the following compiler warning:
dir.c: In function ‘f2fs_create’: dir.c:785:16: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 12 has type ‘long long unsigned int’ [-Wformat=] 785 | MSG(1, "Info: Create %s -> %s\n" | ^~~~~~~~~~~~~~~~~~~~~~~~~ ../include/f2fs_fs.h:252:32: note: in definition of macro ‘MSG’ 252 | printf(fmt, ##__VA_ARGS__); \ | ^~~ Signed-off-by: Bart Van Assche <bvanass...@acm.org> --- fsck/mount.c | 2 +- include/f2fs_fs.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index f15260e02cab..e075d3184f83 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -250,7 +250,7 @@ void print_inode_info(struct f2fs_sb_info *sbi, MSG(0, " - File name : %s%s\n", en, enc_name ? " <encrypted>" : ""); setlocale(LC_ALL, ""); - MSG(0, " - File size : %'llu (bytes)\n", + MSG(0, " - File size : %'" PRIu64 " (bytes)\n", le64_to_cpu(inode->i_size)); return; } diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index 7804dd158de4..cfd3b711f288 100644 --- a/include/f2fs_fs.h +++ b/include/f2fs_fs.h @@ -188,12 +188,12 @@ static inline uint64_t bswap_64(uint64_t val) #endif #if __BYTE_ORDER == __LITTLE_ENDIAN -#define le16_to_cpu(x) ((__u16)(x)) -#define le32_to_cpu(x) ((__u32)(x)) -#define le64_to_cpu(x) ((__u64)(x)) -#define cpu_to_le16(x) ((__u16)(x)) -#define cpu_to_le32(x) ((__u32)(x)) -#define cpu_to_le64(x) ((__u64)(x)) +#define le16_to_cpu(x) ((uint16_t)(x)) +#define le32_to_cpu(x) ((uint32_t)(x)) +#define le64_to_cpu(x) ((uint64_t)(x)) +#define cpu_to_le16(x) ((uint16_t)(x)) +#define cpu_to_le32(x) ((uint32_t)(x)) +#define cpu_to_le64(x) ((uint64_t)(x)) #elif __BYTE_ORDER == __BIG_ENDIAN #define le16_to_cpu(x) bswap_16(x) #define le32_to_cpu(x) bswap_32(x) @@ -291,10 +291,10 @@ static inline uint64_t bswap_64(uint64_t val) do { \ assert(sizeof((ptr)->member) == 8); \ if (c.layout) \ - printf("%-30s %llu\n", \ + printf("%-30s %" PRIu64 "\n", \ #member":", le64_to_cpu(((ptr)->member))); \ else \ - printf("%-30s" "\t\t[0x%8llx : %llu]\n", \ + printf("%-30s" "\t\t[0x%8" PRIx64 " : %" PRIu64 "]\n", \ #member, le64_to_cpu(((ptr)->member)), \ le64_to_cpu(((ptr)->member))); \ } while (0) _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel