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.

Acked-by: Will Deacon <w...@kernel.org>

Thanks!

--
Hector Martin (mar...@marcan.st)
Public Key: https://mrcn.st/pub

Reply via email to