[U-Boot-Users] [PATCH] Fix some more printf() format issues.
Jean-Christophe PLAGNIOL-VILLARD
plagnioj at jcrosoft.com
Sat Jul 12 14:36:34 CEST 2008
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
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 | 2 +-
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, 22 insertions(+), 22 deletions(-)
diff --git a/board/armadillo/flash.c b/board/armadillo/flash.c
index 037a643..8518856 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 a635a65..5024056 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 b653c05..59961cd 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 89ced16..c19d445 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 ca77c8a..bbe5df7 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 aa3932a..ca16578 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 9bd8074..1dd0c99 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 85a0f94..aaf6d98 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 aff11d1..ce99a38 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 ac8a8c1..ad5b1d7 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 4495a80..b291fdb 100644
--- a/cpu/pxa/mmc.c
+++ b/cpu/pxa/mmc.c
@@ -535,7 +535,7 @@ static void mmc_decode_csd(uint32_t * resp)
mmc_dev.removable = 0;
mmc_dev.block_read = mmc_bread;
- printf("Detected: %u blocks of %u bytes (%uMB) ", mmc_dev.lba,
+ printf("Detected: %lu blocks of %lu bytes (%luMB) ", mmc_dev.lba,
mmc_dev.blksz, mmc_dev.lba * mmc_dev.blksz / (1024 * 1024));
}
diff --git a/drivers/mtd/dataflash.c b/drivers/mtd/dataflash.c
index 8247aa0..ed8d966 100644
--- a/drivers/mtd/dataflash.c
+++ b/drivers/mtd/dataflash.c
@@ -162,7 +162,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 1484b0b..0fff820 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 a621ce7..58e710f 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 d1423c1..c7db46e 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 2a26bc0..c96f566 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)) {
--
1.5.6
More information about the U-Boot
mailing list