public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH/RFC] fix several printf() modifiers
Date: Wed, 14 Dec 2011 11:04:07 +0100	[thread overview]
Message-ID: <1323857047-11574-1-git-send-email-andreas.devel@googlemail.com> (raw)
In-Reply-To: <4EE843FE.1070504@wytron.com.tw>

From: Andreas Bie?mann <biessmann@corscience.de>

Some architectures define size_t to unsigned long even though they are 32 bit
architectures.

This patch fixes several warnings when running MAKEALL for avr32 architecture:

---8<---
mmu.c: In function 'mmu_init_r':
mmu.c:25: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'uintptr_t'
fat.c: In function 'do_fat_read':
fat.c:879: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
cmd_sf.c: In function 'spi_flash_update_block':
cmd_sf.c:130: warning: format '%#x' expects type 'unsigend int', but argument 4 has type 'size_t'
cmd_sf.c:135: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'size_t'
--->8---

Signed-off-by: Andreas Bie?mann <biessmann@corscience.de>
cc: Mike Frysinger <vapier@gentoo.org>
cc: Thomas Chou <thomas@wytron.com.tw>
---
 arch/avr32/cpu/at32ap700x/mmu.c |    2 +-
 common/cmd_sf.c                 |    4 ++--
 fs/fat/fat.c                    |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/avr32/cpu/at32ap700x/mmu.c b/arch/avr32/cpu/at32ap700x/mmu.c
index c3a1b93..fda06a9 100644
--- a/arch/avr32/cpu/at32ap700x/mmu.c
+++ b/arch/avr32/cpu/at32ap700x/mmu.c
@@ -22,7 +22,7 @@ void mmu_init_r(unsigned long dest_addr)
 	 */
 	vmr_table_addr = (uintptr_t)&mmu_vmr_table;
 	sysreg_write(PTBR, vmr_table_addr);
-	printf("VMR table @ 0x%08x\n", vmr_table_addr);
+	printf("VMR table @ %#lx\n", vmr_table_addr);
 
 	/* Enable paging */
 	sysreg_write(MMUCR, SYSREG_BF(DRP, 1) | SYSREG_BF(DLA, 1)
diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index 7225656..612fd18 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -127,12 +127,12 @@ static int do_spi_flash_probe(int argc, char * const argv[])
 static const char *spi_flash_update_block(struct spi_flash *flash, u32 offset,
 		size_t len, const char *buf, char *cmp_buf, size_t *skipped)
 {
-	debug("offset=%#x, sector_size=%#x, len=%#x\n",
+	debug("offset=%#x, sector_size=%#x, len=%#zx\n",
 		offset, flash->sector_size, len);
 	if (spi_flash_read(flash, offset, len, cmp_buf))
 		return "read";
 	if (memcmp(cmp_buf, buf, len) == 0) {
-		debug("Skip region %x size %x: no change\n",
+		debug("Skip region %x size %zx: no change\n",
 			offset, len);
 		*skipped += len;
 		return NULL;
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 9a29458..dbb8db9 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -876,7 +876,7 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize,
 	while (1) {
 		int i;
 
-		debug("FAT read sect=%d, clust_size=%d, DIRENTSPERBLOCK=%d\n",
+		debug("FAT read sect=%d, clust_size=%d, DIRENTSPERBLOCK=%zd\n",
 			cursect, mydata->clust_size, DIRENTSPERBLOCK);
 
 		if (disk_read(cursect,
-- 
1.7.7.3

  parent reply	other threads:[~2011-12-14 10:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14  6:36 [U-Boot] cmd_sf warning on size_t Thomas Chou
2011-12-14  9:34 ` Andreas Bießmann
2011-12-14 10:04 ` Andreas Bießmann [this message]
2011-12-15  2:22   ` [U-Boot] [PATCH/RFC] fix several printf() modifiers Thomas Chou
2011-12-15  2:39     ` Graeme Russ
2011-12-15  5:36       ` Mike Frysinger
2011-12-15  5:35   ` Mike Frysinger
2011-12-15  8:30     ` Andreas Bießmann
2011-12-15 19:22       ` Mike Frysinger
2011-12-15  8:56   ` [U-Boot] [PATCH v2 0/3] fix several printf() length modifers Andreas Bießmann
2011-12-15  8:56     ` [U-Boot] [PATCH v2 1/3] cmd_sf.c: fix printf() length modifier Andreas Bießmann
2011-12-15 12:20       ` Mike Frysinger
2011-12-17 22:56       ` Wolfgang Denk
2011-12-15  8:56     ` [U-Boot] [PATCH v2 2/3] fat.c: " Andreas Bießmann
2011-12-15 12:21       ` Mike Frysinger
2011-12-17 22:56       ` Wolfgang Denk
2011-12-15  8:56     ` [U-Boot] [PATCH v2 3/3] avr32:mmu.c: " Andreas Bießmann
2011-12-15 12:21       ` Mike Frysinger
2011-12-17 22:57       ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323857047-11574-1-git-send-email-andreas.devel@googlemail.com \
    --to=andreas.devel@googlemail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox