[U-Boot] [PATCH v2 3/4] fs: btrfs: Fix printf format character warning

Tom Rini trini at konsulko.com
Sat Jan 27 22:23:21 UTC 2018


When printing a size_t value we need to use %zu for portability between
32bit and 64bit targets.

Cc: Marek BehĂșn <marek.behun at nic.cz>
Signed-off-by: Tom Rini <trini at konsulko.com>
---
Changes in v2:
- Drop u32 cast, per Marek.
---
 fs/btrfs/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 2529c2b3b6a6..7e2528c4fb6f 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -147,8 +147,8 @@ static int btrfs_check_super(struct btrfs_super_block *sb)
 
 	if (sb->sys_chunk_array_size < sizeof(struct btrfs_key) +
 	    sizeof(struct btrfs_chunk)) {
-		printf("%s: system chunk array too small %u < %lu\n", __func__,
-		       sb->sys_chunk_array_size, (u32) sizeof(struct btrfs_key)
+		printf("%s: system chunk array too small %u < %zu\n", __func__,
+		       sb->sys_chunk_array_size, sizeof(struct btrfs_key)
 		       + sizeof(struct btrfs_chunk));
 		ret = -1;
 	}
-- 
2.7.4



More information about the U-Boot mailing list