[Skiboot] [PATCH] pflash: Fix printf format warning

Stewart Smith stewart at linux.vnet.ibm.com
Thu Sep 15 17:36:51 AEST 2016


pflash.c: In function ‘print_flash_info’:
pflash.c:138:27: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
  printf("Total size    = %dMB \n", fl_total_size >> 20);

Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 external/pflash/pflash.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/external/pflash/pflash.c b/external/pflash/pflash.c
index 8570acd..a036a86 100644
--- a/external/pflash/pflash.c
+++ b/external/pflash/pflash.c
@@ -29,6 +29,7 @@
 #include <limits.h>
 #include <arpa/inet.h>
 #include <assert.h>
+#include <inttypes.h>
 
 #include <libflash/libflash.h>
 #include <libflash/libffs.h>
@@ -135,7 +136,7 @@ static void print_flash_info(uint32_t toc)
 	printf("Flash info:\n");
 	printf("-----------\n");
 	printf("Name          = %s\n", fl_name);
-	printf("Total size    = %dMB \n", fl_total_size >> 20);
+	printf("Total size    = %"PRIu64"dMB \n", fl_total_size >> 20);
 	printf("Erase granule = %dKB \n", fl_erase_granule >> 10);
 
 	if (bmc_flash)
-- 
2.7.4



More information about the Skiboot mailing list