mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Subject: [PATCH v2 1/9] state: fix compile warnings for dev_err expansion
Date: Mon, 10 Jul 2017 12:33:47 +0200	[thread overview]
Message-ID: <20170710103355.15652-1-s.trumtrar@pengutronix.de> (raw)

Fix the following warnings:

  CC      common/state/backend_format_dtb.o
In file included from include/common.h:33:0,
                 from common/state/backend_format_dtb.c:18:
common/state/backend_format_dtb.c: In function ‘state_backend_format_dtb_verify’:
include/printk.h:52:52: warning: format ‘%d’ expects argument of type ‘int’, but
argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
   (level) <= LOGLEVEL ? dev_printf((level), (dev), (format), ##args) : 0; \
                                                    ^
include/printk.h:63:2: note: in expansion of macro ‘__dev_printf’
  __dev_printf(3, (dev) , format , ## arg)
  ^~~~~~~~~~~~
common/state/backend_format_dtb.c:52:3: note: in expansion of macro ‘dev_err’
   dev_err(fdtb->dev, "Error, stored DTB length (%d) longer than read buffer (%d)\n",
   ^~~~~~~
include/printk.h:52:52: warning: format ‘%d’ expects argument of type ‘int’, but
argument 5 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
   (level) <= LOGLEVEL ? dev_printf((level), (dev), (format), ##args) : 0; \
                                                    ^
include/printk.h:63:2: note: in expansion of macro ‘__dev_printf’
  __dev_printf(3, (dev) , format , ## arg)
  ^~~~~~~~~~~~
common/state/backend_format_dtb.c:52:3: note: in expansion of macro ‘dev_err’
   dev_err(fdtb->dev, "Error, stored DTB length (%d) longer than read buffer (%d)\n",
   ^~~~~~~
  CC      common/state/backend_format_raw.o
In file included from include/common.h:33:0,
                 from common/state/backend_format_raw.c:18:
common/state/backend_format_raw.c: In function ‘backend_format_raw_verify’:
include/printk.h:52:52: warning: format ‘%d’ expects argument of type ‘int’, but
argument 4 has type ‘ssize_t {aka long int}’ [-Wformat=]
   (level) <= LOGLEVEL ? dev_printf((level), (dev), (format), ##args) : 0; \
                                                    ^
include/printk.h:63:2: note: in expansion of macro ‘__dev_printf’
  __dev_printf(3, (dev) , format , ## arg)
  ^~~~~~~~~~~~
common/state/backend_format_raw.c:111:3: note: in expansion of macro ‘dev_err’
   dev_err(backend_raw->dev, "Error, buffer length (%d) is shorter than the minimum required header length\n",
   ^~~~~~~
  CC      common/state/backend_storage.o
In file included from common/state/backend_storage.c:24:0:
common/state/backend_storage.c: In function ‘state_storage_mtd_buckets_init’:
include/printk.h:52:52: warning: format ‘%zu’ expects argument of type ‘size_t’,
but argument 5 has type ‘uint32_t {aka unsigned int}’ [-Wformat=]
   (level) <= LOGLEVEL ? dev_printf((level), (dev), (format), ##args) : 0; \
                                                    ^
include/printk.h:63:2: note: in expansion of macro ‘__dev_printf’
  __dev_printf(3, (dev) , format , ## arg)
  ^~~~~~~~~~~~
common/state/backend_storage.c:250:3: note: in expansion of macro ‘dev_err’
   dev_err(storage->dev, "Offset within the device is not aligned to eraseblocks. Offset is %ld, erasesize %zu\n",
   ^~~~~~~

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 common/state/backend_format_dtb.c | 2 +-
 common/state/backend_format_raw.c | 2 +-
 common/state/backend_storage.c    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/state/backend_format_dtb.c b/common/state/backend_format_dtb.c
index e88cda499b64..4c9d2eefc780 100644
--- a/common/state/backend_format_dtb.c
+++ b/common/state/backend_format_dtb.c
@@ -49,7 +49,7 @@ static int state_backend_format_dtb_verify(struct state_backend_format *format,
 	size_t len = *lenp;
 
 	if (dtb_len > len) {
-		dev_err(fdtb->dev, "Error, stored DTB length (%d) longer than read buffer (%d)\n",
+		dev_err(fdtb->dev, "Error, stored DTB length (%zd) longer than read buffer (%zd)\n",
 			dtb_len, len);
 		return -EINVAL;
 	}
diff --git a/common/state/backend_format_raw.c b/common/state/backend_format_raw.c
index d76718cf8270..2ba97e08a0ae 100644
--- a/common/state/backend_format_raw.c
+++ b/common/state/backend_format_raw.c
@@ -108,7 +108,7 @@ static int backend_format_raw_verify(struct state_backend_format *format,
 	ssize_t complete_len;
 
 	if (len < format_raw_min_length) {
-		dev_err(backend_raw->dev, "Error, buffer length (%d) is shorter than the minimum required header length\n",
+		dev_err(backend_raw->dev, "Error, buffer length (%zd) is shorter than the minimum required header length\n",
 			len);
 		return -EINVAL;
 	}
diff --git a/common/state/backend_storage.c b/common/state/backend_storage.c
index 8d24f7053d3d..91135e99a64f 100644
--- a/common/state/backend_storage.c
+++ b/common/state/backend_storage.c
@@ -247,7 +247,7 @@ static int state_storage_mtd_buckets_init(struct state_backend_storage *storage,
 		end = meminfo->size;
 
 	if (!IS_ALIGNED(storage->offset, meminfo->erasesize)) {
-		dev_err(storage->dev, "Offset within the device is not aligned to eraseblocks. Offset is %ld, erasesize %zu\n",
+		dev_err(storage->dev, "Offset within the device is not aligned to eraseblocks. Offset is %ld, erasesize %u\n",
 			storage->offset, meminfo->erasesize);
 		return -EINVAL;
 	}
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2017-07-10 10:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10 10:33 Steffen Trumtrar [this message]
2017-07-10 10:33 ` [PATCH v2 2/9] common: efi: do not use undefined kconfig option Steffen Trumtrar
2017-07-10 10:33 ` [PATCH v2 3/9] fs: efi: return with correct error code in efifs_stat Steffen Trumtrar
2017-07-10 10:33 ` [PATCH v2 4/9] devfs-core: add function to find cdev by partuuid Steffen Trumtrar
2017-07-10 10:33 ` [PATCH v2 5/9] of: of_path: find device via partuuid Steffen Trumtrar
2017-07-10 10:33 ` [PATCH v2 6/9] efi: efi: load state from devicetree Steffen Trumtrar
2017-07-10 13:49   ` Lucas Stach
2017-07-11 15:00     ` Lucas Stach
2017-07-10 10:33 ` [PATCH v2 7/9] blspec: skip all devicetree tests if entry doesn't specify one Steffen Trumtrar
2017-07-10 10:33 ` [PATCH v2 8/9] efi: efi: register barebox-update handler Steffen Trumtrar
2017-07-10 10:33 ` [PATCH v2 9/9] efi_defconfig: enable STATE Steffen Trumtrar

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=20170710103355.15652-1-s.trumtrar@pengutronix.de \
    --to=s.trumtrar@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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