Skip to content

Commit 568701f

Browse files
vlsunilpalmer-dabbelt
authored andcommitted
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: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202307230357.egcTAefj-lkp@intel.com/ Fixes: a91a9ff ("RISC-V: Add support to build the ACPI core") Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20230724100346.1302937-1-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 2569606 commit 568701f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

arch/riscv/include/asm/acpi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ typedef u64 phys_cpuid_t;
1919
#define PHYS_CPUID_INVALID INVALID_HARTID
2020

2121
/* ACPI table mapping after acpi_permanent_mmap is set */
22-
void *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
22+
void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
2323
#define acpi_os_ioremap acpi_os_ioremap
2424

2525
#define acpi_strict 1 /* No out-of-spec workarounds on RISC-V */

arch/riscv/kernel/acpi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long size)
215215
early_iounmap(map, size);
216216
}
217217

218-
void *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
218+
void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
219219
{
220-
return memremap(phys, size, MEMREMAP_WB);
220+
return (void __iomem *)memremap(phys, size, MEMREMAP_WB);
221221
}
222222

223223
#ifdef CONFIG_PCI

0 commit comments

Comments
 (0)