[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75Vdyug5zbSpGSDEK9hUY+y+ZLDeAyLsc2HAjEzczCpDOSQ@mail.gmail.com>
Date: Thu, 8 Apr 2021 14:24:50 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Hector Martin <marcan@...can.st>
Cc: Will Deacon <will@...nel.org>,
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>,
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 Thu, Apr 8, 2021 at 2:01 PM Hector Martin <marcan@...can.st> wrote:
> On 08/04/2021 06.03, Will Deacon wrote:
> >> I would rewrite above as
> >>
> >> void __iomem *ret;
> >>
> >> ret = ioremap_np(offset, size);
> >> if (ret)
> >> return ret;
> >>
> >> return ioremap(offset, size);
> >
> > Looks like it might be one of those rare occasions where the GCC ternary if
> > extension thingy comes in handy:
> >
> > return ioremap_np(offset, size) ?: ioremap(offset, size);
>
> Today I learned that this one is kosher in kernel code. Handy! Let's go
> with that.
It depends on the maintainer. Greg, for example, doesn't like this. I
have no strong opinion (I use both variants on case-by-case basis),
though I think in headers better to spell out all conditionals
clearly.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists