[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vcghw6=05vbhX5J8sHoo78JMoq5z4w9__XcocrtRVjF3g@mail.gmail.com>
Date: Wed, 7 Apr 2021 16:27:42 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Hector Martin <marcan@...can.st>
Cc: linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
Marc Zyngier <maz@...nel.org>, Rob Herring <robh@...nel.org>,
Arnd Bergmann <arnd@...nel.org>,
Olof Johansson <olof@...om.net>,
Krzysztof Kozlowski <krzk@...nel.org>,
Mark Kettenis <mark.kettenis@...all.nl>,
Tony Lindgren <tony@...mide.com>,
Mohamed Mediouni <mohamed.mediouni@...amail.com>,
Stan Skowronek <stan@...ellium.com>,
Alexander Graf <graf@...zon.com>,
Will Deacon <will@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Mark Rutland <mark.rutland@....com>,
Jonathan Corbet <corbet@....net>,
Catalin Marinas <catalin.marinas@....com>,
Christoph Hellwig <hch@...radead.org>,
"David S. Miller" <davem@...emloft.net>,
devicetree <devicetree@...r.kernel.org>,
Linux Documentation List <linux-doc@...r.kernel.org>,
Linux-Arch <linux-arch@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 11/18] asm-generic/io.h: implement pci_remap_cfgspace
using ioremap_np
On Fri, Apr 2, 2021 at 12:07 PM Hector Martin <marcan@...can.st> wrote:
>
> Now that we have ioremap_np(), we can make pci_remap_cfgspace() default
> to it, falling back to ioremap() on platforms where it is not available.
>
> Remove the arm64 implementation, since that is now redundant. Future
> cleanups should be able to do the same for other arches, and eventually
> make the generic pci_remap_cfgspace() unconditional.
...
> + void __iomem *ret = ioremap_np(offset, size);
> +
> + if (!ret)
> + ret = ioremap(offset, size);
> +
> + return ret;
Usually negative conditions are worse for cognitive functions of human beings.
(On top of that some patterns are applied)
I would rewrite above as
void __iomem *ret;
ret = ioremap_np(offset, size);
if (ret)
return ret;
return ioremap(offset, size);
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists