All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Fix a few printf argument verification warnings
@ 2014-08-26 10:45 Vasili Galka
  2014-09-17  0:44 ` [U-Boot] " Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Vasili Galka @ 2014-08-26 10:45 UTC (permalink / raw)
  To: u-boot

The parameters of size_t type shall be formatted using "%zu" and not
using "%d".

Precision argument for the "%.*s" parameters shall be of int type.

Signed-off-by: Vasili Galka <vvv444@gmail.com>
---
 common/bouncebuf.c    |    2 +-
 common/cmd_mtdparts.c |    4 ++--
 common/spl/spl.c      |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/bouncebuf.c b/common/bouncebuf.c
index 9eece6d..054d9e0 100644
--- a/common/bouncebuf.c
+++ b/common/bouncebuf.c
@@ -23,7 +23,7 @@ static int addr_aligned(struct bounce_buffer *state)
 
 	/* Check if length is aligned */
 	if (state->len != state->len_aligned) {
-		debug("Unaligned buffer length %d\n", state->len);
+		debug("Unaligned buffer length %zu\n", state->len);
 		return 0;
 	}
 
diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c
index 40b6333..d793f74 100644
--- a/common/cmd_mtdparts.c
+++ b/common/cmd_mtdparts.c
@@ -861,7 +861,7 @@ static int device_parse(const char *const mtd_dev, const char **ret, struct mtd_
 	debug("dev type = %d (%s), dev num = %d, mtd-id = %s\n",
 			id->type, MTD_DEV_TYPE(id->type),
 			id->num, id->mtd_id);
-	debug("parsing partitions %.*s\n", (pend ? pend - p : strlen(p)), p);
+	debug("parsing partitions %.*s\n", (int)(pend ? pend - p : strlen(p)), p);
 
 
 	/* parse partitions */
@@ -1006,7 +1006,7 @@ static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_
 	list_for_each(entry, &mtdids) {
 		id = list_entry(entry, struct mtdids, link);
 
-		debug("entry: '%s' (len = %d)\n",
+		debug("entry: '%s' (len = %zu)\n",
 				id->mtd_id, strlen(id->mtd_id));
 
 		if (mtd_id_len != strlen(id->mtd_id))
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 774fdad..b16664f 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -86,7 +86,7 @@ void spl_parse_image_header(const struct image_header *header)
 		spl_image.os = image_get_os(header);
 		spl_image.name = image_get_name(header);
 		debug("spl: payload image: %.*s load addr: 0x%x size: %d\n",
-			sizeof(spl_image.name), spl_image.name,
+			(int)sizeof(spl_image.name), spl_image.name,
 			spl_image.load_addr, spl_image.size);
 	} else {
 		/* Signature not found - assume u-boot.bin */
-- 
1.7.9

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] Fix a few printf argument verification warnings
  2014-08-26 10:45 [U-Boot] [PATCH] Fix a few printf argument verification warnings Vasili Galka
@ 2014-09-17  0:44 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2014-09-17  0:44 UTC (permalink / raw)
  To: u-boot

On Tue, Aug 26, 2014 at 01:45:48PM +0300, Vasili Galka wrote:

> The parameters of size_t type shall be formatted using "%zu" and not
> using "%d".
> 
> Precision argument for the "%.*s" parameters shall be of int type.
> 
> Signed-off-by: Vasili Galka <vvv444@gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140916/71879223/attachment.pgp>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-17  0:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-26 10:45 [U-Boot] [PATCH] Fix a few printf argument verification warnings Vasili Galka
2014-09-17  0:44 ` [U-Boot] " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.