[PATCH v3 2/2] x86: fix build warning int-to-pointer-cast

From: Vamshi K Sthambamkadi
Date: Thu Apr 23 2020 - 08:40:46 EST


Fix warning on x86_32:
arch/x86/boot/compressed/acpi.c:316:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

This is because on 32 bit, cast of acpi_physical_address(u64) to rsdp
pointer in get_acpi_srat_table() triggers this warning.

Signed-off-by: Vamshi K Sthambamkadi <vamshi.k.sthambamkadi@xxxxxxxxx>
---
arch/x86/boot/compressed/acpi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c
index ef2ad72..2fd81f1 100644
--- a/arch/x86/boot/compressed/acpi.c
+++ b/arch/x86/boot/compressed/acpi.c
@@ -280,9 +280,9 @@ acpi_physical_address get_rsdp_addr(void)
*/
#define MAX_ADDR_LEN 19

-static acpi_physical_address get_cmdline_acpi_rsdp(void)
+static unsigned long get_cmdline_acpi_rsdp(void)
{
- acpi_physical_address addr = 0;
+ unsigned long addr = 0;

#ifdef CONFIG_KEXEC
char val[MAX_ADDR_LEN] = { };
@@ -292,7 +292,7 @@ static acpi_physical_address get_cmdline_acpi_rsdp(void)
if (ret < 0)
return 0;

- if (kstrtoull(val, 16, &addr))
+ if (kstrtoul(val, 16, &addr))
return 0;
#endif
return addr;
--
2.7.4