[PATCH] x86/EISA: Remedy address space conflict

From: Thomas Gleixner
Date: Mon Aug 26 2024 - 04:38:44 EST


0-day reported a new sparse warning:

arch/x86/kernel/eisa.c:20:24: sparse:
incorrect type in argument 1 (different address spaces)
expected void const volatile [noderef] __iomem *addr
got void *[assigned] p

Cure it by removing the readl() and dereferencing the pointer directly,
which is correct as it's a memory access.

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Fixes: 80a4da05642c ("x86/EISA: Use memremap() to probe for the EISA BIOS signature")
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: "Maciej W. Rozycki" <macro@xxxxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202408261244.v2gfgSON-lkp@xxxxxxxxx/
---
arch/x86/kernel/eisa.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/x86/kernel/eisa.c
+++ b/arch/x86/kernel/eisa.c
@@ -11,13 +11,13 @@

static __init int eisa_bus_probe(void)
{
- void *p;
+ u32 *p;

if ((xen_pv_domain() && !xen_initial_domain()) || cc_platform_has(CC_ATTR_GUEST_SEV_SNP))
return 0;

p = memremap(0x0FFFD9, 4, MEMREMAP_WB);
- if (p && readl(p) == 'E' + ('I' << 8) + ('S' << 16) + ('A' << 24))
+ if (p && *p == 'E' + ('I' << 8) + ('S' << 16) + ('A' << 24))
EISA_bus = 1;
memunmap(p);
return 0;