Re: [PATCH] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-14 Thread Niklas Schnelle
On Wed, 2021-04-14 at 13:50 +, David Laight wrote: > From: Niklas Schnelle > > Sent: 14 April 2021 13:35 > > > > On Tue, 2021-04-13 at 14:12 +, David Laight wrote: > > > From: Arnd Bergmann > > > > Sent: 13 April 2021 14:40 > > > > > > > > On Tue, Apr 13, 2021 at 3:06 PM David Laight >

RE: [PATCH] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-14 Thread David Laight
From: Niklas Schnelle > Sent: 14 April 2021 13:35 > > On Tue, 2021-04-13 at 14:12 +, David Laight wrote: > > From: Arnd Bergmann > > > Sent: 13 April 2021 14:40 > > > > > > On Tue, Apr 13, 2021 at 3:06 PM David Laight > > > wrote: > > > > From: Arnd Bergmann > > > > > Sent: 13 April 2021

Re: [PATCH] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-14 Thread Niklas Schnelle
On Tue, 2021-04-13 at 14:12 +, David Laight wrote: > From: Arnd Bergmann > > Sent: 13 April 2021 14:40 > > > > On Tue, Apr 13, 2021 at 3:06 PM David Laight > > wrote: > > > From: Arnd Bergmann > > > > Sent: 13 April 2021 13:58 > > > ... > > > > The remaining ones (csky, m68k, sparc32) need

RE: [PATCH] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-13 Thread David Laight
From: Arnd Bergmann > Sent: 13 April 2021 14:40 > > On Tue, Apr 13, 2021 at 3:06 PM David Laight wrote: > > > > From: Arnd Bergmann > > > Sent: 13 April 2021 13:58 > > ... > > > The remaining ones (csky, m68k, sparc32) need to be inspected > > > manually to see if they currently support PCI I/O

Re: [PATCH] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-13 Thread Guo Ren
On Tue, Apr 13, 2021 at 9:40 PM Arnd Bergmann wrote: > > On Tue, Apr 13, 2021 at 3:06 PM David Laight wrote: > > > > From: Arnd Bergmann > > > Sent: 13 April 2021 13:58 > > ... > > > The remaining ones (csky, m68k, sparc32) need to be inspected > > > manually to see if they currently support PCI

Re: [PATCH] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-13 Thread Arnd Bergmann
On Tue, Apr 13, 2021 at 3:06 PM David Laight wrote: > > From: Arnd Bergmann > > Sent: 13 April 2021 13:58 > ... > > The remaining ones (csky, m68k, sparc32) need to be inspected > > manually to see if they currently support PCI I/O space but in > > fact use address zero as the base (with large

RE: [PATCH] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-13 Thread David Laight
From: Arnd Bergmann > Sent: 13 April 2021 13:58 ... > The remaining ones (csky, m68k, sparc32) need to be inspected > manually to see if they currently support PCI I/O space but in > fact use address zero as the base (with large resources) or they > should also turn the operations into a NOP. I'd

Re: [PATCH] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-13 Thread Arnd Bergmann
On Tue, Apr 13, 2021 at 2:38 PM Niklas Schnelle wrote: > On Tue, 2021-04-13 at 14:26 +0200, Arnd Bergmann wrote: > > I think the real underlying problem is that '0' is a particularly bad > > default value, > > we should not have used this one in asm-generic, or maybe have left it as > > mandatory

RE: [PATCH] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-13 Thread David Laight
From: Arnd Bergmann > Sent: 13 April 2021 13:27 > > On Tue, Apr 13, 2021 at 1:54 PM Niklas Schnelle > wrote: > > > > When PCI_IOBASE is not defined, it is set to 0 such that it is ignored > > in calls to the readX/writeX primitives. While mathematically obvious > > this triggers clang's

Re: [PATCH] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-13 Thread Niklas Schnelle
On Tue, 2021-04-13 at 14:26 +0200, Arnd Bergmann wrote: > On Tue, Apr 13, 2021 at 1:54 PM Niklas Schnelle > wrote: > > When PCI_IOBASE is not defined, it is set to 0 such that it is ignored > > in calls to the readX/writeX primitives. While mathematically obvious > > this triggers clang's

Re: [PATCH] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-13 Thread Arnd Bergmann
On Tue, Apr 13, 2021 at 1:54 PM Niklas Schnelle wrote: > > When PCI_IOBASE is not defined, it is set to 0 such that it is ignored > in calls to the readX/writeX primitives. While mathematically obvious > this triggers clang's -Wnull-pointer-arithmetic warning. Indeed, this is an annoying

[PATCH] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-13 Thread Niklas Schnelle
When PCI_IOBASE is not defined, it is set to 0 such that it is ignored in calls to the readX/writeX primitives. While mathematically obvious this triggers clang's -Wnull-pointer-arithmetic warning. An additional complication is that PCI_IOBASE is explicitly typed as "void __iomem *" which causes