From: Simon Glass Date: Sun, 7 Feb 2021 21:27:05 +0000 (-0700) Subject: test: acpi: Fix warnings on 32-bit build X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=634f5ad3aeb7d188d2529c88f31f7902ed3c17cd;p=u-boot.git test: acpi: Fix warnings on 32-bit build 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 --- diff --git a/test/dm/acpi.c b/test/dm/acpi.c index 240187c523..2edab7be54 100644 --- a/test/dm/acpi.c +++ b/test/dm/acpi.c @@ -360,24 +360,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();