[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210727163845.GA16478@lpieralisi>
Date: Tue, 27 Jul 2021 17:38:45 +0100
From: Lorenzo Pieralisi <lorenzo.pieralisi@....com>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Will Deacon <will@...nel.org>,
Hanjun Guo <guohanjun@...wei.com>,
Sudeep Holla <sudeep.holla@....com>,
Catalin Marinas <catalin.marinas@....com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Veronika kabatova <vkabatov@...hat.com>,
Robin Murphy <robin.murphy@....com>
Subject: Re: [PATCH] ACPI: Add memory semantics to acpi_os_map_memory()
On Tue, Jul 27, 2021 at 12:09:47PM +0200, Ard Biesheuvel wrote:
[...]
> > > > +void __iomem __ref
> > > > +*acpi_os_map_iomem(acpi_physical_address phys, acpi_size size)
> > >
> > > I am aware that this just duplicated the prototype above, but I think
> > > this should be
> > >
> > > void __iomem *__ref
> > >
> > > given that the __ref comes after the * in the prototype below.
> >
> > Yes I just moved/duplicated the prototype above but I believe this is
> > consistent with include/acpi/acpi_io.h unless I have not understood
> > what you meant ?
> >
> > It is probably worth changing it in both places to
> >
> > void __iomem *__ref
> >
> > ?
> >
> > I can do that with an additional patch.
> >
>
> Yes, as long as they are all mutually consistent. The __ref is not
> part of the type at all, so it should not be between the void and the
> *, even if the compiler appears to allow it.
Updated into a small series, will repost next week when I am back.
Thanks,
Lorenzo
> > > > +{
> > > > + return __acpi_os_map_iomem(phys, size, false);
> > > > +}
> > > > EXPORT_SYMBOL_GPL(acpi_os_map_iomem);
> > > >
> > > > void *__ref acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
> > > > {
> > > > - return (void *)acpi_os_map_iomem(phys, size);
> > > > + return (void *)__acpi_os_map_iomem(phys, size, true);
> > >
> > > I think this should be (__force void *) to shut up sparse address
> > > space warnings.
> >
> > Yes I can add that attribute in an additional patch and rebase this one
> > on top of it.
> >
> > Thanks,
> > Lorenzo
> >
> > >
> > > > }
> > > > EXPORT_SYMBOL_GPL(acpi_os_map_memory);
> > > >
> > > > diff --git a/include/acpi/acpi_io.h b/include/acpi/acpi_io.h
> > > > index 027faa8883aa..a0212e67d6f4 100644
> > > > --- a/include/acpi/acpi_io.h
> > > > +++ b/include/acpi/acpi_io.h
> > > > @@ -14,6 +14,14 @@ static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
> > > > }
> > > > #endif
> > > >
> > > > +#ifndef acpi_os_memmap
> > > > +static inline void __iomem *acpi_os_memmap(acpi_physical_address phys,
> > > > + acpi_size size)
> > > > +{
> > > > + return ioremap_cache(phys, size);
> > > > +}
> > > > +#endif
> > > > +
> > > > extern bool acpi_permanent_mmap;
> > > >
> > > > void __iomem __ref
> > > > --
> > > > 2.31.0
> > > >
Powered by blists - more mailing lists