All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH 2/7] efi: Fix compiler warnings
Date: Sun,  7 Feb 2021 14:27:02 -0700	[thread overview]
Message-ID: <20210207212707.3958570-3-sjg@chromium.org> (raw)
In-Reply-To: <20210207212707.3958570-1-sjg@chromium.org>

This occur when building on Raspberry Pi 400 (32-bit ARM). Fix them.

Examples:

cmd/efidebug.c: In function ?do_efi_capsule_update?:
cmd/efidebug.c:75:49: warning: cast from pointer to integer of different
	size [-Wpointer-to-int-cast]
  ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL));
                                                 ^
include/efi_loader.h:104:9: note: in definition of macro ?EFI_CALL?
  typeof(exp) _r = exp; \
         ^~~
cmd/efidebug.c:75:49: warning: cast from pointer to integer of different
	size [-Wpointer-to-int-cast]
  ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL));
                                                 ^
include/efi_loader.h:104:19: note: in definition of macro ?EFI_CALL?
  typeof(exp) _r = exp; \
                   ^~~

In file included from include/common.h:20,
                 from lib/efi_loader/efi_capsule.c:9:
lib/efi_loader/efi_capsule.c: In function ?efi_update_capsule?:
include/efi_loader.h:83:8: warning: format ?%lu? expects argument of type
	?long unsigned int?, but argument 10 has type ?size_t?
	{aka ?unsigned int?} [-Wformat=]
  debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \
        ^~~~~~~~~~~~~~~~~~
include/linux/printk.h:37:21: note: in definition of macro ?pr_fmt?
 #define pr_fmt(fmt) fmt
                     ^~~
include/log.h:229:2: note: in expansion of macro ?log?
  log(LOG_CATEGORY, LOGL_DEBUG, fmt, ##args); \
  ^~~
include/log.h:249:2: note: in expansion of macro ?debug_cond?
  debug_cond(_DEBUG, fmt, ##args)
  ^~~~~~~~~~
include/efi_loader.h:83:2: note: in expansion of macro ?debug?
  debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \
  ^~~~~
lib/efi_loader/efi_capsule.c:444:2: note: in expansion of macro ?EFI_ENTRY?
  EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count,
  ^~~~~~~~~
lib/efi_loader/efi_capsule.c:444:19: note: format string is defined here
  EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count,
                 ~~^
                 %u

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 cmd/efidebug.c                | 2 +-
 lib/efi_loader/efi_capsule.c  | 4 ++--
 lib/efi_loader/efi_firmware.c | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/cmd/efidebug.c b/cmd/efidebug.c
index bbbcb0a5464..09c41c950f7 100644
--- a/cmd/efidebug.c
+++ b/cmd/efidebug.c
@@ -72,7 +72,7 @@ static int do_efi_capsule_update(struct cmd_tbl *cmdtp, int flag,
 		       capsule->capsule_image_size);
 	}
 
-	ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL));
+	ret = EFI_CALL(RT->update_capsule(&capsule, 1, (uintptr_t)NULL));
 	if (ret) {
 		printf("Cannot handle a capsule at %p", capsule);
 		return CMD_RET_FAILURE;
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index 0d5a7b63ec8..1c0462ceb21 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -441,7 +441,7 @@ efi_status_t EFIAPI efi_update_capsule(
 	unsigned int i;
 	efi_status_t ret;
 
-	EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count,
+	EFI_ENTRY("%p, %zu, %llu\n", capsule_header_array, capsule_count,
 		  scatter_gather_list);
 
 	if (!capsule_count) {
@@ -501,7 +501,7 @@ efi_status_t EFIAPI efi_query_capsule_caps(
 	unsigned int i;
 	efi_status_t ret;
 
-	EFI_ENTRY("%p, %lu, %p, %p\n", capsule_header_array, capsule_count,
+	EFI_ENTRY("%p, %zu, %p, %p\n", capsule_header_array, capsule_count,
 		  maximum_capsule_size, reset_type);
 
 	if (!maximum_capsule_size) {
diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c
index 5e401bbca2b..7a3cca27936 100644
--- a/lib/efi_loader/efi_firmware.c
+++ b/lib/efi_loader/efi_firmware.c
@@ -299,7 +299,7 @@ efi_status_t EFIAPI efi_firmware_fit_set_image(
 	efi_status_t (*progress)(efi_uintn_t completion),
 	u16 **abort_reason)
 {
-	EFI_ENTRY("%p %d %p %ld %p %p %p\n", this, image_index, image,
+	EFI_ENTRY("%p %d %p %zd %p %p %p\n", this, image_index, image,
 		  image_size, vendor_code, progress, abort_reason);
 
 	if (!image || image_index != 1)
@@ -414,7 +414,7 @@ efi_status_t EFIAPI efi_firmware_raw_set_image(
 	efi_status_t status;
 	efi_uintn_t capsule_payload_size;
 
-	EFI_ENTRY("%p %d %p %ld %p %p %p\n", this, image_index, image,
+	EFI_ENTRY("%p %d %p %zd %p %p %p\n", this, image_index, image,
 		  image_size, vendor_code, progress, abort_reason);
 
 	if (!image)
-- 
2.30.0.478.g8a0d178c01-goog

  parent reply	other threads:[~2021-02-07 21:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-07 21:27 [PATCH 0/7] Fix compiler warnings for 32-bit ARM Simon Glass
2021-02-07 21:27 ` [PATCH 1/7] mkeficapsule: Correct printf() strings Simon Glass
2021-02-07 23:20   ` Heinrich Schuchardt
2021-02-07 21:27 ` Simon Glass [this message]
2021-02-07 21:49   ` [PATCH 2/7] efi: Fix compiler warnings Heinrich Schuchardt
2021-02-07 21:27 ` [PATCH 3/7] pci: swap_case: Allow compilation on 32-bit machines Simon Glass
2021-02-07 21:34   ` Heinrich Schuchardt
2021-02-07 21:27 ` [PATCH 4/7] tpm: Correct warning on 32-bit build Simon Glass
2021-02-07 21:31   ` Heinrich Schuchardt
2021-03-15 15:52   ` Tom Rini
2021-02-07 21:27 ` [PATCH 5/7] test: acpi: Fix warnings " Simon Glass
2021-03-15 15:52   ` Tom Rini
2021-02-07 21:27 ` [PATCH 6/7] doc: sandbox: Fix up dependencies Simon Glass
2021-02-07 21:30   ` Heinrich Schuchardt
2021-02-07 21:27 ` [PATCH 7/7] doc: sandbox: Update instructions on quitting Simon Glass
2021-03-15 15:52   ` Tom Rini
2021-03-15 17:06 ` [PATCH 0/7] Fix compiler warnings for 32-bit ARM Heinrich Schuchardt

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=20210207212707.3958570-3-sjg@chromium.org \
    --to=sjg@chromium.org \
    --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 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.