mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2 1/9] state: fix compile warnings for dev_err expansion
@ 2017-07-10 10:33 Steffen Trumtrar
  2017-07-10 10:33 ` [PATCH v2 2/9] common: efi: do not use undefined kconfig option Steffen Trumtrar
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Steffen Trumtrar @ 2017-07-10 10:33 UTC (permalink / raw)
  To: barebox; +Cc: Steffen Trumtrar

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

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

end of thread, other threads:[~2017-07-11 15:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-10 10:33 [PATCH v2 1/9] state: fix compile warnings for dev_err expansion Steffen Trumtrar
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox