Fix printf errors.
The compiler will help find mismatches between printf formats and
arguments if you let it. This patch adds the necessary attributes to
declarations in include/common.h, then begins to correct the resulting
compiler warnings. Some of these were bugs, e.g., "$d" instead of
"%d" and incorrect arguments. Others were just annoying, like
int-long mismatches on a system where both are 32 bits. It's worth
fixing the annoying errors to catch the real ones.
Signed-off-by: Andrew Klossner <andrew@cesa.opbu.xerox.com>
diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c
index 3c1c18b..8d54675 100644
--- a/lib_ppc/bootm.c
+++ b/lib_ppc/bootm.c
@@ -105,7 +105,7 @@
if (size < bootm_size) {
ulong base = bootmap_base + size;
- printf("WARNING: adjusting available memory to %x\n", size);
+ printf("WARNING: adjusting available memory to %lx\n", size);
lmb_reserve(lmb, base, bootm_size - size);
}
@@ -672,7 +672,7 @@
*/
fdt_blob = (char *)fdt_addr;
debug ("* fdt: raw FDT blob\n");
- printf ("## Flattened Device Tree blob at %08lx\n", fdt_blob);
+ printf ("## Flattened Device Tree blob at %08lx\n", (long)fdt_blob);
}
break;
default:
@@ -680,7 +680,7 @@
goto error;
}
- printf (" Booting using the fdt blob at 0x%x\n", fdt_blob);
+ printf (" Booting using the fdt blob at 0x%x\n", (int)fdt_blob);
} else if (images->legacy_hdr_valid &&
image_check_type (&images->legacy_hdr_os_copy, IH_TYPE_MULTI)) {
@@ -699,7 +699,7 @@
if (fdt_len) {
fdt_blob = (char *)fdt_data;
- printf (" Booting using the fdt at 0x%x\n", fdt_blob);
+ printf (" Booting using the fdt at 0x%x\n", (int)fdt_blob);
if (fdt_check_header (fdt_blob) != 0) {
fdt_error ("image is not a fdt");