diff mbox

[U-Boot,v2,2/3] fat.c: fix printf() length modifier

Message ID 1323939415-21743-3-git-send-email-andreas.devel@googlemail.com
State Accepted
Commit 2d1b83b346431bfee7574822d356e5a28ead21d3
Headers show

Commit Message

Andreas Bießmann Dec. 15, 2011, 8:56 a.m. UTC
From: Andreas Bießmann <biessmann@corscience.de>

The DIRENTSPERBLOCK utilizes sizeof() which will return a size_t which has no
fixed size. Therefor use correct length modifer for printf() statement to
prevent compiler warnings.

This patch fixes following warning:

---8<---
fat.c: In function 'do_fat_read':
fat.c:879: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
--->8---

Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
cc: Mike Frysinger <vapier@gentoo.org>
cc: Thomas Chou <thomas@wytron.com.tw>
cc: rjones@nexus-tech.net
cc: kharris@nexus-tech.net
---
changes since v1: split off into single patches

total: 0 errors, 0 warnings, 8 lines checked

NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE

0002-fat.c-fix-printf-length-modifier.patch has no obvious style problems and is ready for submission.

 fs/fat/fat.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Mike Frysinger Dec. 15, 2011, 12:21 p.m. UTC | #1
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
Wolfgang Denk Dec. 17, 2011, 10:56 p.m. UTC | #2
Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,

In message <1323939415-21743-3-git-send-email-andreas.devel@googlemail.com> you wrote:
> From: Andreas Bießmann <biessmann@corscience.de>
> 
> The DIRENTSPERBLOCK utilizes sizeof() which will return a size_t which has no
> fixed size. Therefor use correct length modifer for printf() statement to
> prevent compiler warnings.
> 
> This patch fixes following warning:
> 
> ---8<---
> fat.c: In function 'do_fat_read':
> fat.c:879: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
> --->8---
> 
> Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
> cc: Mike Frysinger <vapier@gentoo.org>
> cc: Thomas Chou <thomas@wytron.com.tw>
> cc: rjones@nexus-tech.net
> cc: kharris@nexus-tech.net
> ---
> changes since v1: split off into single patches
> 
> total: 0 errors, 0 warnings, 8 lines checked
> 
> NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE
> 
> 0002-fat.c-fix-printf-length-modifier.patch has no obvious style problems and is ready for submission.
> 
>  fs/fat/fat.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied to "next" branch, thanks.

Best regards,

Wolfgang Denk
diff mbox

Patch

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,