mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] RISC-V: ACPI: fix two __iomem cast warnings
@ 2026-03-11 10:22 Ben Dooks
  2026-04-02 21:31 ` Paul Walmsley
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Dooks @ 2026-03-11 10:22 UTC (permalink / raw)
  To: linux-riscv, palmer, pjw; +Cc: linux-kernel, alex, Ben Dooks

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 *addr
arch/riscv/kernel/acpi.c:224:24:    got void [noderef] __iomem *map

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 arch/riscv/kernel/acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c
index 71698ee11621..0d52942f94d5 100644
--- a/arch/riscv/kernel/acpi.c
+++ b/arch/riscv/kernel/acpi.c
@@ -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)
-- 
2.37.2.352.g3c44437643


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] RISC-V: ACPI: fix two __iomem cast warnings
  2026-03-11 10:22 [PATCH] RISC-V: ACPI: fix two __iomem cast warnings Ben Dooks
@ 2026-04-02 21:31 ` Paul Walmsley
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Walmsley @ 2026-04-02 21:31 UTC (permalink / raw)
  To: Ben Dooks; +Cc: linux-riscv, palmer, pjw, linux-kernel, alex

Hi Ben,

On Wed, 11 Mar 2026, Ben Dooks wrote:

> 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 *addr
> arch/riscv/kernel/acpi.c:224:24:    got void [noderef] __iomem *map
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-02 21:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-11 10:22 [PATCH] RISC-V: ACPI: fix two __iomem cast warnings Ben Dooks
2026-04-02 21:31 ` Paul Walmsley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®