[PATCH 01/11] mm/ioremap: change the return value of io[re|un]map_allowed

Baoquan He bhe at redhat.com
Sat Aug 6 18:58:47 PDT 2022


On 08/04/22 at 05:42pm, Alexander Gordeev wrote:
> On Mon, Aug 01, 2022 at 10:40:19PM +0800, Baoquan He wrote:
> 
> Hi Baoquan,
> 
> > --- a/arch/arm64/mm/ioremap.c
> > +++ b/arch/arm64/mm/ioremap.c
> > @@ -3,19 +3,20 @@
> >  #include <linux/mm.h>
> >  #include <linux/io.h>
> >  
> > -bool ioremap_allowed(phys_addr_t phys_addr, size_t size, unsigned long prot)
> > +void __iomem *ioremap_allowed(phys_addr_t phys_addr, size_t size, unsigned long prot)
> >  {
> >  	unsigned long last_addr = phys_addr + size - 1;
> > +	int ret = -EINVAL;
> 
> If ret variable is really needed?

There are two places where -EINVAL need be returned. I can remove
variable ret, and return -EINVAL directly if there's concern.

Thanks again for looking into this series.




More information about the linux-arm-kernel mailing list