Re: [PATCH] x86/EISA: Use memremap() to probe for the EISA BIOS signature

From: Christoph Hellwig
Date: Wed Aug 28 2024 - 02:17:17 EST


On Sat, Aug 24, 2024 at 11:17:10PM +0100, Maciej W. Rozycki wrote:
> - void __iomem *p;
> + void *p;
>
> if ((xen_pv_domain() && !xen_initial_domain()) || cc_platform_has(CC_ATTR_GUEST_SEV_SNP))
> return 0;
>
> - p = ioremap(0x0FFFD9, 4);
> + p = memremap(0x0FFFD9, 4, MEMREMAP_WB);
> if (p && readl(p) == 'E' + ('I' << 8) + ('S' << 16) + ('A' << 24))
> EISA_bus = 1;

readl requires and __iomem pointer. If this is just a memory region you
can and should directly dereference the address instead.

Note that sparse will complain about the above as well.