RISC-V: ACPI: Fix acpi_os_ioremap to return iomem address
PATCH v3 1/1 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.
---
Changes since v2:
1) Removed unnecessary __force.
2) Removed unnecessary space after cast to fix checkpatch --strict warning.
Changes since v1:
1) Removed enhancements from the fix patch.
arch/riscv/include/asm/acpi.h | 2 +- arch/riscv/kernel/acpi.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/riscv/include/asm/acpi.h +1 -1
@@ -19,7 +19,7 @@ typedef u64 phys_cpuid_t;#define PHYS_CPUID_INVALID INVALID_HARTID/* 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_strict 1/* No out-of-spec workarounds on RISC-V */
arch/riscv/kernel/acpi.c +2 -2
@@ -215,9 +215,9 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long 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
Signature · 7 lines
2.39.2 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 10 lines · Sunil V L
acpi_os_ioremap()currently is a wrapper tomemremap()on RISC-V. But the callers ofacpi_os_ioremap()expect it to return__iomemaddress and hence sparse tool reports a new warning. Fix this issue by type casting to__iomemtype.Reported-by kernel test robot <[email protected]>Fixes a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core")Signed-off-by Sunil V L <[email protected]>---
Surprisingly, my automation already tested this patch. Usually there's a several hour delay between posting & testing.
Thanks,
Conor.
Quoted 43 lines
Changes since v2:
1) Removed unnecessary__force.
2) Removed unnecessary space after cast to fix checkpatch --strict warning.Changes since v1:
1) Removed enhancements from the fix patch.arch/riscv/include/asm/acpi.h | 2 +- arch/riscv/kernel/acpi.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)arch/riscv/include/asm/acpi.h +1
-1@@ -19,7 +19,7 @@ typedef u64 phys_cpuid_t;#define PHYS_CPUID_INVALID INVALID_HARTID/* 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_strict 1/* No out-of-spec workarounds on RISC-V */ arch/riscv/kernel/acpi.c +2
-2@@ -215,9 +215,9 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long 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 Signature · 1 line
2.39.2
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
This patch was applied to riscv/linux.git (fixes) by Palmer Dabbelt <[email protected]>:
Hello:
This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <[email protected]>:
Quoted 11 lines · On Mon, 24 Jul 2023 15:33:46 +0530 you wrote:
acpi_os_ioremap()currently is a wrapper tomemremap()on RISC-V. But the callers ofacpi_os_ioremap()expect it to return__iomemaddress and hence sparse tool reports a new warning. Fix this issue by type casting to__iomemtype.Reported-by kernel test robot <[email protected]>Fixes a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core")Signed-off-by Sunil V L <[email protected]>[...]
Here is the summary with links:
- [v3,-fixes] RISC-V: ACPI: Fix acpi_os_ioremap to return iomem address
https://git.kernel.org/riscv/c/568701fee366
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Palmer Dabbelt
AppliedQuoted 6 lines · Sunil V L
acpi_os_ioremap()currently is a wrapper tomemremap()on RISC-V. But the callers ofacpi_os_ioremap()expect it to return__iomemaddress and hence sparse tool reports a new warning. Fix this issue by type casting to__iomemtype.
Applied, thanks!
[1/1] RISC-V: ACPI: Fix acpi_os_ioremap to return iomem address
https://git.kernel.org/palmer/c/568701fee366
Best regards,
Signature · 1 line
Palmer Dabbelt <[email protected]>