[1/4] kexec: Fix printf warning
diff mbox series

Message ID aa9a3104cda82608321e94ab9acdfe1ecb75923b.1523465700.git.geoff@infradead.org
State Not Applicable
Headers show
Series
  • [1/4] kexec: Fix printf warning
Related show

Commit Message

Geoff Levand April 11, 2018, 5:03 p.m. UTC
Fixes warnings like these when building kexec for powerpc (32 bit):

  kexec.c: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘uint64_t

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 kexec/kexec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/kexec/kexec.c b/kexec/kexec.c
index 313d9fe..29fa5fa 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -20,6 +20,7 @@ 
  */
 
 #define _GNU_SOURCE
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
@@ -1235,7 +1236,7 @@  static void print_crashkernel_region_size(void)
 		return;
 	}
 
-	printf("%lu\n", (start != end) ? (end - start + 1) : 0UL);
+	printf("%" PRIu64 "\n", (start != end) ? (end - start + 1) : 0UL);
 }
 
 int main(int argc, char *argv[])