Thread (32 messages) 32 messages, 6 authors, 2021-04-08

Re: [PATCH v4 11/18] asm-generic/io.h: implement pci_remap_cfgspace using ioremap_np

From: Hector Martin <hidden>
Date: 2021-04-08 11:01:41
Also in: linux-arch, linux-devicetree, linux-doc, lkml

On 08/04/2021 06.03, Will Deacon wrote:
quoted
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 <will@kernel.org>
Thanks!

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help