[PATCH v1] um: fix incompatible argument type in iounmap()

Arnd Bergmann arnd at arndb.de
Wed Apr 9 12:07:17 PDT 2025


On Wed, Apr 9, 2025, at 19:07, Geert Uytterhoeven wrote:
>
> On Wed, 9 Apr 2025 at 16:48, Miguel Ojeda
> <miguel.ojeda.sandonis at gmail.com> wrote:
>> On Wed, Apr 9, 2025 at 8:16 AM FUJITA Tomonori
>> <fujita.tomonori at gmail.com> wrote:
>> >
>> > Align iounmap() signature with other architectures.
>>
>> Most indeed have `volatile`, but nios2 and m68k don't -- Cc'ing them
>> just in case.
>
> Indeed. Apparently the volatile keyword has not always been there...
> Why does iounmap() need the volatile keyword?
> Why does pci_iounmap() not have the volatile keyword?

In the old days, a lot of drivers marked MMIO pointers
as 'volatile void *' rather than 'void __iomem *', so iounmap()
and the readl() family of accessors need to be compatible
with that type to avoid a warning.

By the time we introduced pci_iomap()/pci_iounmap(), this was
no longer common, so they never needed it.

In theory we could go through all the old drivers and
also remove the 'volatile' markers from struct members that
store __iomem pointers, but there is no practical benefit to
that.

     Arnd



More information about the linux-um mailing list