From 0a5676befb0c590212a53f7627fa5d0d8a84bf34 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sat, 12 Jul 2008 14:36:34 +0200 Subject: [PATCH] Fix some more printf() format issues. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- board/armadillo/flash.c | 2 +- board/delta/nand.c | 2 +- board/integratorcp/flash.c | 6 +++--- board/mp2usb/flash.c | 2 +- board/versatile/flash.c | 2 +- board/zylonite/nand.c | 2 +- common/cmd_flash.c | 4 ++-- common/cmd_nvedit.c | 2 +- common/cmd_onenand.c | 4 ++-- common/env_onenand.c | 2 +- cpu/pxa/mmc.c | 6 ++++-- drivers/mtd/dataflash.c | 2 +- drivers/net/smc911x.c | 4 ++-- drivers/usb/usbdcore.c | 2 +- fs/jffs2/jffs2_1pass.c | 4 ++-- net/net.c | 2 +- 16 files changed, 25 insertions(+), 23 deletions(-) diff --git a/board/armadillo/flash.c b/board/armadillo/flash.c index 037a6430da..8518856cb1 100644 --- a/board/armadillo/flash.c +++ b/board/armadillo/flash.c @@ -279,7 +279,7 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt) int i, rc; wp = (addr & ~1); /* get lower word aligned address */ - printf ("Writing %d short data to 0x%p from 0x%p.\n ", cnt, wp, src); + printf ("Writing %lu short data to 0x%lx from 0x%p.\n ", cnt, wp, src); /* * handle unaligned start bytes diff --git a/board/delta/nand.c b/board/delta/nand.c index a635a6521b..5024056bc3 100644 --- a/board/delta/nand.c +++ b/board/delta/nand.c @@ -254,7 +254,7 @@ static unsigned long dfc_wait_event(unsigned long event) break; } if(get_delta(start) > timeout) { - DFC_DEBUG1("dfc_wait_event: TIMEOUT waiting for event: 0x%x.\n", event); + DFC_DEBUG1("dfc_wait_event: TIMEOUT waiting for event: 0x%lx.\n", event); return 0xff000000; } diff --git a/board/integratorcp/flash.c b/board/integratorcp/flash.c index b653c058e1..59961cdab6 100644 --- a/board/integratorcp/flash.c +++ b/board/integratorcp/flash.c @@ -393,7 +393,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last) *addr = (FPW) 0x00D000D0; } else { #ifdef DEBUG - printf ("Timeout,0x%08x\n", status); + printf ("Timeout,0x%08lx\n", status); #else printf("Timeout\n"); #endif @@ -515,7 +515,7 @@ static int write_data (flash_info_t * info, ulong dest, FPW data) /* Check if Flash is (sufficiently) erased */ if ((*addr & data) != data) { - printf ("not erased at %08lx (%x)\n", (ulong) addr, *addr); + printf ("not erased at %08lx (%lx)\n", (ulong) addr, *addr); return (2); } @@ -542,7 +542,7 @@ static int write_data (flash_info_t * info, ulong dest, FPW data) #ifdef DEBUG *addr = (FPW) 0x00700070; status = *addr; - printf("## status=0x%08x, addr=0x%08x\n", status, addr); + printf("## status=0x%08lx, addr=0x%p\n", status, addr); #endif *addr = (FPW) 0x00500050; /* clear status register cmd */ *addr = (FPW) 0x00FF00FF; /* restore read mode */ diff --git a/board/mp2usb/flash.c b/board/mp2usb/flash.c index 89ced163bb..c19d445e20 100644 --- a/board/mp2usb/flash.c +++ b/board/mp2usb/flash.c @@ -426,7 +426,7 @@ static int write_data (flash_info_t *info, ulong dest, FPW data) /* Check if Flash is (sufficiently) erased */ if ((*addr & data) != data) { - printf ("not erased at %08lx (%lx)\n", (ulong) addr, *addr); + printf ("not erased at %08lx (%lx)\n", (ulong) addr, (ulong) *addr); return (2); } /* diff --git a/board/versatile/flash.c b/board/versatile/flash.c index ca77c8a29e..bbe5df724d 100644 --- a/board/versatile/flash.c +++ b/board/versatile/flash.c @@ -476,7 +476,7 @@ static int write_data (flash_info_t * info, ulong dest, FPW data) /* Check if Flash is (sufficiently) erased */ if ((*addr & data) != data) { - printf ("not erased at %08lx (%x)\n", (ulong) addr, *addr); + printf ("not erased at %08lx (%lx)\n", (ulong) addr, (ulong) *addr); return (2); } diff --git a/board/zylonite/nand.c b/board/zylonite/nand.c index aa3932ad2d..ca16578432 100644 --- a/board/zylonite/nand.c +++ b/board/zylonite/nand.c @@ -254,7 +254,7 @@ static unsigned long dfc_wait_event(unsigned long event) break; } if(get_delta(start) > timeout) { - DFC_DEBUG1("dfc_wait_event: TIMEOUT waiting for event: 0x%x.\n", event); + DFC_DEBUG1("dfc_wait_event: TIMEOUT waiting for event: 0x%lx.\n", event); return 0xff000000; } diff --git a/common/cmd_flash.c b/common/cmd_flash.c index 9bd8074bfb..1dd0c99ff7 100644 --- a/common/cmd_flash.c +++ b/common/cmd_flash.c @@ -342,7 +342,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) puts ("Bad sector specification\n"); return 1; } - printf ("Erase Flash Sectors %d-%d in Bank # %d ", + printf ("Erase Flash Sectors %d-%d in Bank # %ld ", sect_first, sect_last, (info-flash_info)+1); rcode = flash_erase(info, sect_first, sect_last); return rcode; @@ -534,7 +534,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) puts ("Bad sector specification\n"); return 1; } - printf("%sProtect Flash Sectors %d-%d in Bank # %d\n", + printf("%sProtect Flash Sectors %d-%d in Bank # %ld\n", p ? "" : "Un-", sect_first, sect_last, (info-flash_info)+1); for (i = sect_first; i <= sect_last; i++) { diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 85a0f94f0f..aaf6d98da8 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -99,7 +99,7 @@ int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } } - printf("\nEnvironment size: %d/%d bytes\n", i, ENV_SIZE); + printf("\nEnvironment size: %d/%ld bytes\n", i, ENV_SIZE); return 0; } diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c index aff11d15c9..ce99a38ca5 100644 --- a/common/cmd_onenand.c +++ b/common/cmd_onenand.c @@ -70,14 +70,14 @@ int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) if (!end || end < 0) end = start; - printf("Erase block from %d to %d\n", start, end); + printf("Erase block from %lu to %lu\n", start, end); for (block = start; block <= end; block++) { instr.addr = block << onenand_chip.erase_shift; instr.len = 1 << onenand_chip.erase_shift; ret = onenand_erase(&onenand_mtd, &instr); if (ret) { - printf("erase failed %d\n", block); + printf("erase failed %lu\n", block); break; } } diff --git a/common/env_onenand.c b/common/env_onenand.c index ac8a8c15e7..ad5b1d7aa9 100644 --- a/common/env_onenand.c +++ b/common/env_onenand.c @@ -103,7 +103,7 @@ int saveenv(void) instr.addr = env_addr; instr.addr -= (unsigned long)onenand_chip.base; if (onenand_erase(&onenand_mtd, &instr)) { - printf("OneNAND: erase failed at 0x%08x\n", env_addr); + printf("OneNAND: erase failed at 0x%08lx\n", env_addr); return 1; } diff --git a/cpu/pxa/mmc.c b/cpu/pxa/mmc.c index 8c529a3717..2c86a01a03 100644 --- a/cpu/pxa/mmc.c +++ b/cpu/pxa/mmc.c @@ -535,8 +535,10 @@ static void mmc_decode_csd(uint32_t * resp) mmc_dev.removable = 0; mmc_dev.block_read = mmc_bread; - printf("Detected: %lu blocks of %lu bytes (%luMB) ", (unsigned long)mmc_dev.lba, - mmc_dev.blksz, mmc_dev.lba * mmc_dev.blksz / (1024 * 1024)); + printf("Detected: %lu blocks of %lu bytes (%luMB) ", + mmc_dev.lba, + mmc_dev.blksz, + mmc_dev.lba * mmc_dev.blksz / (1024 * 1024)); } int diff --git a/drivers/mtd/dataflash.c b/drivers/mtd/dataflash.c index a092dc634f..0ad48cdae9 100644 --- a/drivers/mtd/dataflash.c +++ b/drivers/mtd/dataflash.c @@ -173,7 +173,7 @@ void AT91F_DataflashSetEnv (void) if((env & FLAG_SETENV) == FLAG_SETENV) { start = dataflash_info[i].Device.area_list[j].start; - sprintf((char*) s,"%X",start); + sprintf((char*) s,"%lX",start); setenv((char*) area_list[part].label,(char*) s); } part++; diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 1484b0b696..0fff820803 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c @@ -597,7 +597,7 @@ int eth_init(bd_t *bd) val = reg_read(BYTE_TEST); if (val != 0x87654321) { - printf(DRIVERNAME ": Invalid chip endian 0x%08x\n", val); + printf(DRIVERNAME ": Invalid chip endian 0x%08lx\n", val); goto err_out; } @@ -606,7 +606,7 @@ int eth_init(bd_t *bd) if (chip_ids[i].id == val) break; } if (!chip_ids[i].id) { - printf(DRIVERNAME ": Unknown chip ID %04x\n", val); + printf(DRIVERNAME ": Unknown chip ID %04lx\n", val); goto err_out; } diff --git a/drivers/usb/usbdcore.c b/drivers/usb/usbdcore.c index a621ce7a39..58e710f369 100644 --- a/drivers/usb/usbdcore.c +++ b/drivers/usb/usbdcore.c @@ -551,7 +551,7 @@ struct urb *usbd_alloc_urb (struct usb_device_instance *device, struct usb_endpo struct urb *urb; if( !(urb = (struct urb*)malloc(sizeof(struct urb))) ) { - usberr(" F A T A L: malloc(%u) FAILED!!!!", sizeof(struct urb)); + usberr(" F A T A L: malloc(%lu) FAILED!!!!", sizeof(struct urb)); return NULL; } diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c index d1423c1cda..c7db46e053 100644 --- a/fs/jffs2/jffs2_1pass.c +++ b/fs/jffs2/jffs2_1pass.c @@ -1213,12 +1213,12 @@ jffs2_1pass_build_lists(struct part_info * part) } else if (node->nodetype == JFFS2_NODETYPE_CLEANMARKER) { if (node->totlen != sizeof(struct jffs2_unknown_node)) printf("OOPS Cleanmarker has bad size " - "%d != %d\n", node->totlen, + "%d != %lu\n", node->totlen, sizeof(struct jffs2_unknown_node)); } else if (node->nodetype == JFFS2_NODETYPE_PADDING) { if (node->totlen < sizeof(struct jffs2_unknown_node)) printf("OOPS Padding has bad size " - "%d < %d\n", node->totlen, + "%d < %lu\n", node->totlen, sizeof(struct jffs2_unknown_node)); } else { printf("Unknown node type: %x len %d " diff --git a/net/net.c b/net/net.c index 2a26bc0dd1..c96f566fab 100644 --- a/net/net.c +++ b/net/net.c @@ -1390,7 +1390,7 @@ NetReceive(volatile uchar * inpkt, int len) puts ("Got IP\n"); #endif if (len < IP_HDR_SIZE) { - debug ("len bad %d < %d\n", len, IP_HDR_SIZE); + debug ("len bad %d < %ld\n", len, IP_HDR_SIZE); return; } if (len < ntohs(ip->ip_len)) { -- 2.25.1