Message ID | 20191031003154.21969-1-linux@rasmusvillemoes.dk (mailing list archive) |
---|---|
Headers | show |
Series | powerpc: make iowrite32be etc. inline | expand |
On 31/10/2019 01.31, Rasmus Villemoes wrote: > At first I tried something that wouldn't need to touch anything > outside arch/powerpc/, but I ended up with conditional inclusion of > asm-generic headers and/or duplicating a lot of their contents. Urrgh, this is much worse than I feared. Already 1/5 is broken because asm-generic.h includes asm-generic/iomap.h conditionally, but asm-generic/pci_iomap.h unconditionally, so now users of io.h with CONFIG_PCI and !CONFIG_GENERIC_IOMAP get an external declaration of pci_iounmap they didn't use to, in addition to the static inline defined in io.h. And I didn't think 2/5 could break anything - on the premise that if somebody already have a non-trivial define of ioread16, they couldn't possibly also include asm-generic/iomap.h. alpha proves me wrong; as long as one doesn't define ioread16 until after iomap.h has been parsed, there's no problem (well, except of course if some static inline that uses ioread16 got parsed between the compiler seeing the extern declaration and alpha then defining the ioread16 macro, but apparently that doesn't happen). So sorry for the noise. Maybe I'll just have to bite the bullet and introduce private qe_iowrite32be etc. and define them based on $ARCH. Any better ideas would be much appreciated. Thanks, Rasmus
On Thu, Oct 31, 2019 at 8:39 AM Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote: > On 31/10/2019 01.31, Rasmus Villemoes wrote: > > So sorry for the noise. Maybe I'll just have to bite the bullet and > introduce private qe_iowrite32be etc. and define them based on $ARCH. > Any better ideas would be much appreciated. We use that approach in a number of drivers already, I think it's ok to add it to another driver. Just make the powerpc case use out_be32 and everything else use iowrite32_be. You may also be able to enable the driver for CONFIG_COMPILE_TEST after that. Arnd