diff mbox series

[v3,3/4] include/asm-generic/io.h: remove performing pointer arithmetic on a null pointer

Message ID 1670229006-4063-1-git-send-email-chensong_2000@189.cn (mailing list archive)
State Superseded
Headers show
Series reorganize trace_peobe_tmpl.h | expand

Commit Message

Song Chen Dec. 5, 2022, 8:30 a.m. UTC
kernel test robot reports below warnings:

   In file included from kernel/trace/trace_events_synth.c:18:
   In file included from include/linux/trace_events.h:9:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:547:31: warning: performing pointer arithmetic
	on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __raw_readb(PCI_IOBASE + addr);
                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic
	on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note:
		expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))

The reason could be constant literal zero converted to any pointer type decays
into the null pointer constant.

I'm not sure why those warnings are only triggered when building hexagon instead
of x86 or arm, but anyway, i found a work around:

	void *pci_iobase = PCI_IOBASE;
	val = __raw_readb(pci_iobase + addr);

The pointer is not evaluated at compile time, so the warnings are removed.

Signed-off-by: Song Chen <chensong_2000@189.cn>
Reported-by: kernel test robot <lkp@intel.com>
---
 include/asm-generic/io.h | 45 +++++++++++++++++++++++++++++-----------
 1 file changed, 33 insertions(+), 12 deletions(-)

Comments

Arnd Bergmann Dec. 5, 2022, 10:04 a.m. UTC | #1
On Mon, Dec 5, 2022, at 09:30, Song Chen wrote:
> kernel test robot reports below warnings:
>
>    In file included from kernel/trace/trace_events_synth.c:18:
>    In file included from include/linux/trace_events.h:9:
>    In file included from include/linux/hardirq.h:11:
>    In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
>    In file included from include/asm-generic/hardirq.h:17:
>    In file included from include/linux/irq.h:20:
>    In file included from include/linux/io.h:13:
>    In file included from arch/hexagon/include/asm/io.h:334:
>    include/asm-generic/io.h:547:31: warning: performing pointer arithmetic
> 	on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>            val = __raw_readb(PCI_IOBASE + addr);
>                              ~~~~~~~~~~ ^
>    include/asm-generic/io.h:560:61: warning: performing pointer arithmetic
> 	on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>            val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
>                                                            ~~~~~~~~~~ ^
>    include/uapi/linux/byteorder/little_endian.h:37:51: note:
> 		expanded from macro '__le16_to_cpu'
>    #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>
> The reason could be constant literal zero converted to any pointer type decays
> into the null pointer constant.
>
> I'm not sure why those warnings are only triggered when building hexagon instead
> of x86 or arm, but anyway, i found a work around:
>
> 	void *pci_iobase = PCI_IOBASE;
> 	val = __raw_readb(pci_iobase + addr);
>
> The pointer is not evaluated at compile time, so the warnings are removed.
>
> Signed-off-by: Song Chen <chensong_2000@189.cn>
> Reported-by: kernel test robot <lkp@intel.com>

The code is still wrong, you just hide the warning, so no, this is
not a correct fix. When PCI_IOBASE is NULL, any call to
inb() etc is a NULL pointer dereference that immediately crashes
the kernel, so the correct solution is to not allow building code
that uses port I/O on kernels that are configured not to
support port I/O.

We have discussed this bit multiple times, and Niklas Schnelle
last posted his series to fix this as an RFC in [1].

      Arnd

[1] https://lore.kernel.org/lkml/20220429135108.2781579-1-schnelle@linux.ibm.com/
Song Chen Dec. 6, 2022, 6:01 a.m. UTC | #2
Hi,

在 2022/12/5 18:04, Arnd Bergmann 写道:
> On Mon, Dec 5, 2022, at 09:30, Song Chen wrote:
>> kernel test robot reports below warnings:
>>
>>     In file included from kernel/trace/trace_events_synth.c:18:
>>     In file included from include/linux/trace_events.h:9:
>>     In file included from include/linux/hardirq.h:11:
>>     In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
>>     In file included from include/asm-generic/hardirq.h:17:
>>     In file included from include/linux/irq.h:20:
>>     In file included from include/linux/io.h:13:
>>     In file included from arch/hexagon/include/asm/io.h:334:
>>     include/asm-generic/io.h:547:31: warning: performing pointer arithmetic
>> 	on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>>             val = __raw_readb(PCI_IOBASE + addr);
>>                               ~~~~~~~~~~ ^
>>     include/asm-generic/io.h:560:61: warning: performing pointer arithmetic
>> 	on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>>             val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
>>                                                             ~~~~~~~~~~ ^
>>     include/uapi/linux/byteorder/little_endian.h:37:51: note:
>> 		expanded from macro '__le16_to_cpu'
>>     #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>>
>> The reason could be constant literal zero converted to any pointer type decays
>> into the null pointer constant.
>>
>> I'm not sure why those warnings are only triggered when building hexagon instead
>> of x86 or arm, but anyway, i found a work around:
>>
>> 	void *pci_iobase = PCI_IOBASE;
>> 	val = __raw_readb(pci_iobase + addr);
>>
>> The pointer is not evaluated at compile time, so the warnings are removed.
>>
>> Signed-off-by: Song Chen <chensong_2000@189.cn>
>> Reported-by: kernel test robot <lkp@intel.com>
> 
> The code is still wrong, you just hide the warning, so no, this is
> not a correct fix. When PCI_IOBASE is NULL, any call to
> inb() etc is a NULL pointer dereference that immediately crashes
> the kernel, so the correct solution is to not allow building code
> that uses port I/O on kernels that are configured not to
> support port I/O.
> 
> We have discussed this bit multiple times, and Niklas Schnelle
> last posted his series to fix this as an RFC in [1].
> 
>        Arnd
> 
> [1] https://lore.kernel.org/lkml/20220429135108.2781579-1-schnelle@linux.ibm.com/
> 

Trace triggers the warning accidentally by including io.h indirectly 
because of the absence of PCI_IOBASE in hexagon. So what trace can do in 
this case is either to suppress warning or just ignore it, the warning 
will go away as long as hexagon has put PCI_IOBASE in place or 
implemented its own inb() etc, i think they will do it sooner or later.

Introducing HAS_IOPORT to trace seems no necessary and too much impact.

/Song
Arnd Bergmann Dec. 6, 2022, 2:22 p.m. UTC | #3
On Tue, Dec 6, 2022, at 07:01, Song Chen wrote:
> 在 2022/12/5 18:04, Arnd Bergmann 写道:
>> On Mon, Dec 5, 2022, at 09:30, Song Chen wrote:
>> 
>> We have discussed this bit multiple times, and Niklas Schnelle
>> last posted his series to fix this as an RFC in [1].
>> 
>
> Trace triggers the warning accidentally by including io.h indirectly 
> because of the absence of PCI_IOBASE in hexagon. So what trace can do in 
> this case is either to suppress warning or just ignore it, the warning 
> will go away as long as hexagon has put PCI_IOBASE in place or 
> implemented its own inb() etc, i think they will do it sooner or later.

hexagon/riscv/s390 should not implement inb(), there is no reason
for that because no hardware uses it. Half of the other architectures
that currently implement inb() should not do so either.

> Introducing HAS_IOPORT to trace seems no necessary and too much impact.

I don't think that trace has anything to do with it, the asm-generic
header should just not provde the inb() interface on architectures
that don't use it.

    Arnd
kernel test robot Dec. 6, 2022, 10:50 p.m. UTC | #4
Hi Song,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on arnd-asm-generic/master]
[also build test WARNING on linus/master v6.1-rc8 next-20221206]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Song-Chen/reorganize-trace_peobe_tmpl-h/20221206-205410
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git master
patch link:    https://lore.kernel.org/r/1670229006-4063-1-git-send-email-chensong_2000%40189.cn
patch subject: [PATCH v3 3/4] include/asm-generic/io.h: remove performing pointer arithmetic on a null pointer
config: arc-randconfig-s051-20221206
compiler: arc-elf-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/intel-lab-lkp/linux/commit/7dbc7861ae2072e177c0665ac10fe0e3810bd454
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Song-Chen/reorganize-trace_peobe_tmpl-h/20221206-205410
        git checkout 7dbc7861ae2072e177c0665ac10fe0e3810bd454
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arc SHELL=/bin/bash drivers/i2c/busses/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

sparse warnings: (new ones prefixed by >>)
   drivers/i2c/busses/i2c-parport.c: note: in included file (through arch/arc/include/asm/io.h, include/linux/parport_pc.h, include/linux/parport.h):
>> include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
   include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
   include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *

vim +586 include/asm-generic/io.h

   581	
   582	#if !defined(outb) && !defined(_outb)
   583	#define _outb _outb
   584	static inline void _outb(u8 value, unsigned long addr)
   585	{
 > 586		void *pci_iobase = PCI_IOBASE;
   587	
   588		__io_pbw();
   589		__raw_writeb(value, pci_iobase + addr);
   590		__io_paw();
   591	}
   592	#endif
   593
kernel test robot Dec. 27, 2022, 10:34 a.m. UTC | #5
Hi Song,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on arnd-asm-generic/master]
[also build test WARNING on linus/master v6.2-rc1 next-20221226]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Song-Chen/reorganize-trace_peobe_tmpl-h/20221206-205410
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git master
patch link:    https://lore.kernel.org/r/1670229006-4063-1-git-send-email-chensong_2000%40189.cn
patch subject: [PATCH v3 3/4] include/asm-generic/io.h: remove performing pointer arithmetic on a null pointer
config: csky-randconfig-s033-20221225
compiler: csky-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/intel-lab-lkp/linux/commit/7dbc7861ae2072e177c0665ac10fe0e3810bd454
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Song-Chen/reorganize-trace_peobe_tmpl-h/20221206-205410
        git checkout 7dbc7861ae2072e177c0665ac10fe0e3810bd454
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=csky olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=csky SHELL=/bin/bash drivers/input/joystick/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

sparse warnings: (new ones prefixed by >>)
   drivers/input/joystick/joydump.c: note: in included file (through arch/csky/include/asm/io.h, include/linux/gameport.h):
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
--
   drivers/input/joystick/grip_mp.c: note: in included file (through arch/csky/include/asm/io.h, include/linux/gameport.h):
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
--
   drivers/input/joystick/tmdc.c: note: in included file (through arch/csky/include/asm/io.h, include/linux/gameport.h):
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
--
   drivers/input/joystick/cobra.c: note: in included file (through arch/csky/include/asm/io.h, include/linux/gameport.h):
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
--
   drivers/input/joystick/grip.c: note: in included file (through arch/csky/include/asm/io.h, include/linux/gameport.h):
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
--
   drivers/input/joystick/gf2k.c: note: in included file (through arch/csky/include/asm/io.h, include/linux/gameport.h):
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
--
   drivers/input/joystick/interact.c: note: in included file (through arch/csky/include/asm/io.h, include/linux/gameport.h):
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
--
   drivers/input/joystick/analog.c: note: in included file (through arch/csky/include/asm/io.h, include/linux/gameport.h):
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
--
   drivers/input/joystick/sidewinder.c: note: in included file (through arch/csky/include/asm/io.h, include/linux/gameport.h):
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *
>> include/asm-generic/io.h:545:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:545:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:545:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:548:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:548:38: sparse:     expected void const volatile [noderef] __iomem *addr
   include/asm-generic/io.h:548:38: sparse:     got void *
   include/asm-generic/io.h:586:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void *pci_iobase @@     got void [noderef] __iomem * @@
   include/asm-generic/io.h:586:28: sparse:     expected void *pci_iobase
   include/asm-generic/io.h:586:28: sparse:     got void [noderef] __iomem *
   include/asm-generic/io.h:589:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void * @@
   include/asm-generic/io.h:589:40: sparse:     expected void volatile [noderef] __iomem *addr
   include/asm-generic/io.h:589:40: sparse:     got void *

vim +545 include/asm-generic/io.h

   533	
   534	/*
   535	 * {in,out}{b,w,l}() access little endian I/O. {in,out}{b,w,l}_p() can be
   536	 * implemented on hardware that needs an additional delay for I/O accesses to
   537	 * take effect.
   538	 */
   539	
   540	#if !defined(inb) && !defined(_inb)
   541	#define _inb _inb
   542	static inline u8 _inb(unsigned long addr)
   543	{
   544		u8 val;
 > 545		void *pci_iobase = PCI_IOBASE;
   546	
   547		__io_pbr();
   548		val = __raw_readb(pci_iobase + addr);
   549		__io_par(val);
   550		return val;
   551	}
   552	#endif
   553	
   554	#if !defined(inw) && !defined(_inw)
   555	#define _inw _inw
   556	static inline u16 _inw(unsigned long addr)
   557	{
   558		u16 val;
   559		void *pci_iobase = PCI_IOBASE;
   560	
   561		__io_pbr();
   562		val = __le16_to_cpu((__le16 __force)__raw_readw(pci_iobase + addr));
   563		__io_par(val);
   564		return val;
   565	}
   566	#endif
   567	
   568	#if !defined(inl) && !defined(_inl)
   569	#define _inl _inl
   570	static inline u32 _inl(unsigned long addr)
   571	{
   572		u32 val;
   573		void *pci_iobase = PCI_IOBASE;
   574	
   575		__io_pbr();
   576		val = __le32_to_cpu((__le32 __force)__raw_readl(pci_iobase + addr));
   577		__io_par(val);
   578		return val;
   579	}
   580	#endif
   581	
   582	#if !defined(outb) && !defined(_outb)
   583	#define _outb _outb
   584	static inline void _outb(u8 value, unsigned long addr)
   585	{
 > 586		void *pci_iobase = PCI_IOBASE;
   587	
   588		__io_pbw();
   589		__raw_writeb(value, pci_iobase + addr);
   590		__io_paw();
   591	}
   592	#endif
   593
diff mbox series

Patch

diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index a68f8fbf423b..394538fd2585 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -542,9 +542,10 @@  static inline void writesq(volatile void __iomem *addr, const void *buffer,
 static inline u8 _inb(unsigned long addr)
 {
 	u8 val;
+	void *pci_iobase = PCI_IOBASE;
 
 	__io_pbr();
-	val = __raw_readb(PCI_IOBASE + addr);
+	val = __raw_readb(pci_iobase + addr);
 	__io_par(val);
 	return val;
 }
@@ -555,9 +556,10 @@  static inline u8 _inb(unsigned long addr)
 static inline u16 _inw(unsigned long addr)
 {
 	u16 val;
+	void *pci_iobase = PCI_IOBASE;
 
 	__io_pbr();
-	val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
+	val = __le16_to_cpu((__le16 __force)__raw_readw(pci_iobase + addr));
 	__io_par(val);
 	return val;
 }
@@ -568,9 +570,10 @@  static inline u16 _inw(unsigned long addr)
 static inline u32 _inl(unsigned long addr)
 {
 	u32 val;
+	void *pci_iobase = PCI_IOBASE;
 
 	__io_pbr();
-	val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
+	val = __le32_to_cpu((__le32 __force)__raw_readl(pci_iobase + addr));
 	__io_par(val);
 	return val;
 }
@@ -580,8 +583,10 @@  static inline u32 _inl(unsigned long addr)
 #define _outb _outb
 static inline void _outb(u8 value, unsigned long addr)
 {
+	void *pci_iobase = PCI_IOBASE;
+
 	__io_pbw();
-	__raw_writeb(value, PCI_IOBASE + addr);
+	__raw_writeb(value, pci_iobase + addr);
 	__io_paw();
 }
 #endif
@@ -590,8 +595,10 @@  static inline void _outb(u8 value, unsigned long addr)
 #define _outw _outw
 static inline void _outw(u16 value, unsigned long addr)
 {
+	void *pci_iobase = PCI_IOBASE;
+
 	__io_pbw();
-	__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
+	__raw_writew((u16 __force)cpu_to_le16(value), pci_iobase + addr);
 	__io_paw();
 }
 #endif
@@ -600,8 +607,10 @@  static inline void _outw(u16 value, unsigned long addr)
 #define _outl _outl
 static inline void _outl(u32 value, unsigned long addr)
 {
+	void *pci_iobase = PCI_IOBASE;
+
 	__io_pbw();
-	__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
+	__raw_writel((u32 __force)cpu_to_le32(value), pci_iobase + addr);
 	__io_paw();
 }
 #endif
@@ -689,7 +698,9 @@  static inline void outl_p(u32 value, unsigned long addr)
 #define insb insb
 static inline void insb(unsigned long addr, void *buffer, unsigned int count)
 {
-	readsb(PCI_IOBASE + addr, buffer, count);
+	void *pci_iobase = PCI_IOBASE;
+
+	readsb(pci_iobase + addr, buffer, count);
 }
 #endif
 
@@ -697,7 +708,9 @@  static inline void insb(unsigned long addr, void *buffer, unsigned int count)
 #define insw insw
 static inline void insw(unsigned long addr, void *buffer, unsigned int count)
 {
-	readsw(PCI_IOBASE + addr, buffer, count);
+	void *pci_iobase = PCI_IOBASE;
+
+	readsw(pci_iobase + addr, buffer, count);
 }
 #endif
 
@@ -705,7 +718,9 @@  static inline void insw(unsigned long addr, void *buffer, unsigned int count)
 #define insl insl
 static inline void insl(unsigned long addr, void *buffer, unsigned int count)
 {
-	readsl(PCI_IOBASE + addr, buffer, count);
+	void *pci_iobase = PCI_IOBASE;
+
+	readsl(pci_iobase + addr, buffer, count);
 }
 #endif
 
@@ -714,7 +729,9 @@  static inline void insl(unsigned long addr, void *buffer, unsigned int count)
 static inline void outsb(unsigned long addr, const void *buffer,
 			 unsigned int count)
 {
-	writesb(PCI_IOBASE + addr, buffer, count);
+	void *pci_iobase = PCI_IOBASE;
+
+	writesb(pci_iobase + addr, buffer, count);
 }
 #endif
 
@@ -723,7 +740,9 @@  static inline void outsb(unsigned long addr, const void *buffer,
 static inline void outsw(unsigned long addr, const void *buffer,
 			 unsigned int count)
 {
-	writesw(PCI_IOBASE + addr, buffer, count);
+	void *pci_iobase = PCI_IOBASE;
+
+	writesw(pci_iobase + addr, buffer, count);
 }
 #endif
 
@@ -732,7 +751,9 @@  static inline void outsw(unsigned long addr, const void *buffer,
 static inline void outsl(unsigned long addr, const void *buffer,
 			 unsigned int count)
 {
-	writesl(PCI_IOBASE + addr, buffer, count);
+	void *pci_iobase = PCI_IOBASE;
+
+	writesl(pci_iobase + addr, buffer, count);
 }
 #endif