diff mbox series

[5/7] test: acpi: Fix warnings on 32-bit build

Message ID 20210207212707.3958570-6-sjg@chromium.org
State Accepted
Commit 634f5ad3aeb7d188d2529c88f31f7902ed3c17cd
Delegated to: Tom Rini
Headers show
Series Fix compiler warnings for 32-bit ARM | expand

Commit Message

Simon Glass Feb. 7, 2021, 9:27 p.m. UTC
Some format strings use the wrong type. Fix them.

Example warnings:

In file included from test/dm/acpi.c:22:
test/dm/acpi.c: In function ‘dm_test_acpi_cmd_list’:
test/dm/acpi.c:362:21: warning: format ‘%lx’ expects argument of type
  ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=]
  ut_assert_nextline("RSDP %08lx %06lx (v02 U-BOOT)", addr,
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       sizeof(struct acpi_rsdp));
       ~~~~~~~~~~~~~~~~~~~~~~~~
include/test/ut.h:282:33: note: in definition of macro ‘ut_assert_nextline’
  if (ut_check_console_line(uts, fmt, ##args)) {   \
                                 ^~~

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

 test/dm/acpi.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Tom Rini March 15, 2021, 3:52 p.m. UTC | #1
On Sun, Feb 07, 2021 at 02:27:05PM -0700, Simon Glass wrote:

> Some format strings use the wrong type. Fix them.
> 
> Example warnings:
> 
> In file included from test/dm/acpi.c:22:
> test/dm/acpi.c: In function ‘dm_test_acpi_cmd_list’:
> test/dm/acpi.c:362:21: warning: format ‘%lx’ expects argument of type
>   ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=]
>   ut_assert_nextline("RSDP %08lx %06lx (v02 U-BOOT)", addr,
>                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>        sizeof(struct acpi_rsdp));
>        ~~~~~~~~~~~~~~~~~~~~~~~~
> include/test/ut.h:282:33: note: in definition of macro ‘ut_assert_nextline’
>   if (ut_check_console_line(uts, fmt, ##args)) {   \
>                                  ^~~
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/test/dm/acpi.c b/test/dm/acpi.c
index e0a323ecd40..9dc9950eddc 100644
--- a/test/dm/acpi.c
+++ b/test/dm/acpi.c
@@ -359,24 +359,24 @@  static int dm_test_acpi_cmd_list(struct unit_test_state *uts)
 	run_command("acpi list", 0);
 	addr = (ulong)map_to_sysmem(buf);
 	ut_assert_nextline("ACPI tables start at %lx", addr);
-	ut_assert_nextline("RSDP %08lx %06lx (v02 U-BOOT)", addr,
+	ut_assert_nextline("RSDP %08lx %06zx (v02 U-BOOT)", addr,
 			   sizeof(struct acpi_rsdp));
 	addr = ALIGN(addr + sizeof(struct acpi_rsdp), 16);
-	ut_assert_nextline("RSDT %08lx %06lx (v01 U-BOOT U-BOOTBL %x INTL 0)",
+	ut_assert_nextline("RSDT %08lx %06zx (v01 U-BOOT U-BOOTBL %x INTL 0)",
 			   addr, sizeof(struct acpi_table_header) +
 			   3 * sizeof(u32), U_BOOT_BUILD_DATE);
 	addr = ALIGN(addr + sizeof(struct acpi_rsdt), 16);
-	ut_assert_nextline("XSDT %08lx %06lx (v01 U-BOOT U-BOOTBL %x INTL 0)",
+	ut_assert_nextline("XSDT %08lx %06zx (v01 U-BOOT U-BOOTBL %x INTL 0)",
 			   addr, sizeof(struct acpi_table_header) +
 			   3 * sizeof(u64), U_BOOT_BUILD_DATE);
 	addr = ALIGN(addr + sizeof(struct acpi_xsdt), 64);
-	ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %x INTL 0)",
+	ut_assert_nextline("DMAR %08lx %06zx (v01 U-BOOT U-BOOTBL %x INTL 0)",
 			   addr, sizeof(struct acpi_dmar), U_BOOT_BUILD_DATE);
 	addr = ALIGN(addr + sizeof(struct acpi_dmar), 16);
-	ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %x INTL 0)",
+	ut_assert_nextline("DMAR %08lx %06zx (v01 U-BOOT U-BOOTBL %x INTL 0)",
 			   addr, sizeof(struct acpi_dmar), U_BOOT_BUILD_DATE);
 	addr = ALIGN(addr + sizeof(struct acpi_dmar), 16);
-	ut_assert_nextline("DMAR %08lx %06lx (v01 U-BOOT U-BOOTBL %x INTL 0)",
+	ut_assert_nextline("DMAR %08lx %06zx (v01 U-BOOT U-BOOTBL %x INTL 0)",
 			   addr, sizeof(struct acpi_dmar), U_BOOT_BUILD_DATE);
 	ut_assert_console_end();