Commit 568701fe authored by Sunil V L's avatar Sunil V L Committed by Palmer Dabbelt

RISC-V: ACPI: Fix acpi_os_ioremap to return iomem address

acpi_os_ioremap() currently is a wrapper to memremap() on
RISC-V. But the callers of acpi_os_ioremap() expect it to
return __iomem address and hence sparse tool reports a new
warning. Fix this issue by type casting to  __iomem type.
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202307230357.egcTAefj-lkp@intel.com/
Fixes: a91a9ffb ("RISC-V: Add support to build the ACPI core")
Signed-off-by: default avatarSunil V L <sunilvl@ventanamicro.com>
Reviewed-by: default avatarConor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230724100346.1302937-1-sunilvl@ventanamicro.comSigned-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent 25696067
...@@ -19,7 +19,7 @@ typedef u64 phys_cpuid_t; ...@@ -19,7 +19,7 @@ typedef u64 phys_cpuid_t;
#define PHYS_CPUID_INVALID INVALID_HARTID #define PHYS_CPUID_INVALID INVALID_HARTID
/* ACPI table mapping after acpi_permanent_mmap is set */ /* ACPI table mapping after acpi_permanent_mmap is set */
void *acpi_os_ioremap(acpi_physical_address phys, acpi_size size); void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
#define acpi_os_ioremap acpi_os_ioremap #define acpi_os_ioremap acpi_os_ioremap
#define acpi_strict 1 /* No out-of-spec workarounds on RISC-V */ #define acpi_strict 1 /* No out-of-spec workarounds on RISC-V */
......
...@@ -215,9 +215,9 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long size) ...@@ -215,9 +215,9 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long size)
early_iounmap(map, size); early_iounmap(map, size);
} }
void *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
{ {
return memremap(phys, size, MEMREMAP_WB); return (void __iomem *)memremap(phys, size, MEMREMAP_WB);
} }
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment