diff options
author | Bart Van Assche <bvanassche@acm.org> | 2022-04-21 15:18:17 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-04-22 11:43:13 -0700 |
commit | 7a5109ff62c97646276db38aa5cdf805e43ed8ea (patch) | |
tree | e286f9c184674e996daf27fc075226473f71b179 | |
parent | e61203c2aae8656a178234bc20df2e4a5994407b (diff) | |
download | f2fs-tools-7a5109ff62c97646276db38aa5cdf805e43ed8ea.tar.gz |
f2fs_fs.h: Use standard fixed width integer types
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 <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fsck/mount.c | 2 | ||||
-rw-r--r-- | include/f2fs_fs.h | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/fsck/mount.c b/fsck/mount.c index f15260e..e075d31 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 86fc6b0..1294c23 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) |