RISC-V: ACPI: fix two __iomem cast warnings
PATCH 1/1 RISC-V: ACPI: fix two __iomem cast warnings
The __acpi_map_table() and __acpi_unmap_table() return and take __iomem tagged pointers. Add a cast to fix the sparse warnings:
arch/riscv/kernel/acpi.c:216:30: warning: incorrect type in return expression (different address spaces)arch/riscv/kernel/acpi.c:216:30: expected void [noderef] __iomem *arch/riscv/kernel/acpi.c:216:30: got void *arch/riscv/kernel/acpi.c:224:24: warning: incorrect type in argument 1 (different address spaces)arch/riscv/kernel/acpi.c:224:24: expected void *addrarch/riscv/kernel/acpi.c:224:24: got void [noderef] __iomem *map
--- arch/riscv/kernel/acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/kernel/acpi.c +2 -2
@@ -213,7 +213,7 @@ void __init __iomem *__acpi_map_table(unsigned long phys, unsigned long size)if (!size)return NULL ; -return early_memremap (phys, size); +return (void __iomem *)early_memremap (phys, size); }void __init __acpi_unmap_table (void __iomem *map,unsigned long size)
@@ -221,7 +221,7 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long size)if (!map || !size)return ; -early_memunmap (map, size); +early_memunmap ((void __force *)map, size); }void __iomem *acpi_os_ioremap (acpi_physical_address phys,acpi_size size)
Signature · 1 line
2.37.2.352.g3c44437643
Paul Walmsley
maintainerHi Ben,
Quoted 4 lines · Ben Dooks
The
__acpi_map_table()and__acpi_unmap_table()return and take__iomemtagged pointers. Add a cast to fix the sparse warnings:
Quoted 8 lines
arch/riscv/kernel/acpi.c:216:30: warning: incorrect type in return expression (different address spaces)arch/riscv/kernel/acpi.c:216:30: expected void [noderef]__iomem*arch/riscv/kernel/acpi.c:216:30: got void *arch/riscv/kernel/acpi.c:224:24: warning: incorrect type in argument 1 (different address spaces)arch/riscv/kernel/acpi.c:224:24: expected void *addrarch/riscv/kernel/acpi.c:224:24: got void [noderef]__iomem*mapSigned-off-by Ben Dooks <[email protected]>
Thanks for taking a look at this. It appears that some of the other architectures have the same issue. Could you come up with a series that addresses the others as well? You might need to get the ACPI folks involved; it's not really clear to me why __acpi_map_table() needs to return an __iomem *.
- Paul