drivers/pci/switch/switchtec.c:1075:23: sparse: sparse: incorrect type in argument 1 (different address spaces)
From: kernel test robot
Date: Wed Jun 24 2020 - 12:02:55 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 3e08a95294a4fb3702bb3d35ed08028433c37fe6
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 6 days ago
config: arm-randconfig-s031-20200624 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# save the attached .config to linux build tree
make W=1 C=1 ARCH=arm CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
sparse warnings: (new ones prefixed by >>)
drivers/pci/switch/switchtec.c:943:31: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected unsigned int [noderef] [usertype] __iomem * @@ got void * @@
drivers/pci/switch/switchtec.c:943:31: sparse: expected unsigned int [noderef] [usertype] __iomem *
drivers/pci/switch/switchtec.c:943:31: sparse: got void *
drivers/pci/switch/switchtec.c:951:39: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected unsigned int [noderef] [usertype] __iomem * @@ got void * @@
drivers/pci/switch/switchtec.c:951:39: sparse: expected unsigned int [noderef] [usertype] __iomem *
drivers/pci/switch/switchtec.c:951:39: sparse: got void *
drivers/pci/switch/switchtec.c:954:39: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected unsigned int [noderef] [usertype] __iomem * @@ got void * @@
drivers/pci/switch/switchtec.c:954:39: sparse: expected unsigned int [noderef] [usertype] __iomem *
drivers/pci/switch/switchtec.c:954:39: sparse: got void *
drivers/pci/switch/switchtec.c:1067:32: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got struct switchtec_ioctl_pff_port *up @@
drivers/pci/switch/switchtec.c:1067:32: sparse: expected void const [noderef] __user *from
drivers/pci/switch/switchtec.c:1067:32: sparse: got struct switchtec_ioctl_pff_port *up
drivers/pci/switch/switchtec.c:1072:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct part_cfg_regs *pcfg @@ got struct part_cfg_regs [noderef] __iomem * @@
drivers/pci/switch/switchtec.c:1072:22: sparse: expected struct part_cfg_regs *pcfg
drivers/pci/switch/switchtec.c:1072:22: sparse: got struct part_cfg_regs [noderef] __iomem *
>> drivers/pci/switch/switchtec.c:1075:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got unsigned int * @@
>> drivers/pci/switch/switchtec.c:1075:23: sparse: expected void const [noderef] __iomem *addr
drivers/pci/switch/switchtec.c:1075:23: sparse: got unsigned int *
drivers/pci/switch/switchtec.c:1081:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got unsigned int * @@
drivers/pci/switch/switchtec.c:1081:23: sparse: expected void const [noderef] __iomem *addr
drivers/pci/switch/switchtec.c:1081:23: sparse: got unsigned int *
drivers/pci/switch/switchtec.c:1088:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got unsigned int * @@
drivers/pci/switch/switchtec.c:1088:31: sparse: expected void const [noderef] __iomem *addr
drivers/pci/switch/switchtec.c:1088:31: sparse: got unsigned int *
drivers/pci/switch/switchtec.c:1100:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *to @@ got struct switchtec_ioctl_pff_port *up @@
drivers/pci/switch/switchtec.c:1100:26: sparse: expected void [noderef] __user *to
drivers/pci/switch/switchtec.c:1100:26: sparse: got struct switchtec_ioctl_pff_port *up
drivers/pci/switch/switchtec.c:1112:32: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got struct switchtec_ioctl_pff_port *up @@
drivers/pci/switch/switchtec.c:1112:32: sparse: expected void const [noderef] __user *from
drivers/pci/switch/switchtec.c:1112:32: sparse: got struct switchtec_ioctl_pff_port *up
drivers/pci/switch/switchtec.c:1116:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct part_cfg_regs *pcfg @@ got struct part_cfg_regs [noderef] __iomem *mmio_part_cfg @@
drivers/pci/switch/switchtec.c:1116:22: sparse: expected struct part_cfg_regs *pcfg
drivers/pci/switch/switchtec.c:1116:22: sparse: got struct part_cfg_regs [noderef] __iomem *mmio_part_cfg
drivers/pci/switch/switchtec.c:1118:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct part_cfg_regs *pcfg @@ got struct part_cfg_regs [noderef] __iomem * @@
drivers/pci/switch/switchtec.c:1118:22: sparse: expected struct part_cfg_regs *pcfg
drivers/pci/switch/switchtec.c:1118:22: sparse: got struct part_cfg_regs [noderef] __iomem *
drivers/pci/switch/switchtec.c:1124:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got unsigned int * @@
drivers/pci/switch/switchtec.c:1124:25: sparse: expected void const [noderef] __iomem *addr
drivers/pci/switch/switchtec.c:1124:25: sparse: got unsigned int *
drivers/pci/switch/switchtec.c:1127:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got unsigned int * @@
drivers/pci/switch/switchtec.c:1127:25: sparse: expected void const [noderef] __iomem *addr
drivers/pci/switch/switchtec.c:1127:25: sparse: got unsigned int *
drivers/pci/switch/switchtec.c:1134:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got unsigned int * @@
drivers/pci/switch/switchtec.c:1134:25: sparse: expected void const [noderef] __iomem *addr
drivers/pci/switch/switchtec.c:1134:25: sparse: got unsigned int *
drivers/pci/switch/switchtec.c:1138:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *to @@ got struct switchtec_ioctl_pff_port *up @@
drivers/pci/switch/switchtec.c:1138:26: sparse: expected void [noderef] __user *to
drivers/pci/switch/switchtec.c:1138:26: sparse: got struct switchtec_ioctl_pff_port *up
drivers/pci/switch/switchtec.c:1171:47: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct switchtec_ioctl_pff_port *up @@ got void [noderef] __user *argp @@
drivers/pci/switch/switchtec.c:1171:47: sparse: expected struct switchtec_ioctl_pff_port *up
drivers/pci/switch/switchtec.c:1171:47: sparse: got void [noderef] __user *argp
drivers/pci/switch/switchtec.c:1174:47: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct switchtec_ioctl_pff_port *up @@ got void [noderef] __user *argp @@
drivers/pci/switch/switchtec.c:1174:47: sparse: expected struct switchtec_ioctl_pff_port *up
drivers/pci/switch/switchtec.c:1174:47: sparse: got void [noderef] __user *argp
drivers/pci/switch/switchtec.c:1487:43: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct part_cfg_regs *pcfg @@ got struct part_cfg_regs [noderef] __iomem *mmio_part_cfg @@
drivers/pci/switch/switchtec.c:1487:43: sparse: expected struct part_cfg_regs *pcfg
drivers/pci/switch/switchtec.c:1487:43: sparse: got struct part_cfg_regs [noderef] __iomem *mmio_part_cfg
drivers/pci/switch/switchtec.c:1497:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got unsigned int * @@
drivers/pci/switch/switchtec.c:1497:15: sparse: expected void const [noderef] __iomem *addr
drivers/pci/switch/switchtec.c:1497:15: sparse: got unsigned int *
drivers/pci/switch/switchtec.c:1501:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got unsigned int * @@
drivers/pci/switch/switchtec.c:1501:15: sparse: expected void const [noderef] __iomem *addr
drivers/pci/switch/switchtec.c:1501:15: sparse: got unsigned int *
drivers/pci/switch/switchtec.c:1506:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got unsigned int * @@
drivers/pci/switch/switchtec.c:1506:23: sparse: expected void const [noderef] __iomem *addr
drivers/pci/switch/switchtec.c:1506:23: sparse: got unsigned int *
--
>> fs/pstore/ram_core.c:278:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *to @@ got unsigned char * @@
>> fs/pstore/ram_core.c:278:9: sparse: expected void volatile [noderef] __iomem *to
fs/pstore/ram_core.c:278:9: sparse: got unsigned char *
>> fs/pstore/ram_core.c:311:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const volatile [noderef] __iomem *from @@ got unsigned char * @@
>> fs/pstore/ram_core.c:311:9: sparse: expected void const volatile [noderef] __iomem *from
fs/pstore/ram_core.c:311:9: sparse: got unsigned char *
fs/pstore/ram_core.c:312:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const volatile [noderef] __iomem *from @@ got unsigned char * @@
fs/pstore/ram_core.c:312:9: sparse: expected void const volatile [noderef] __iomem *from
fs/pstore/ram_core.c:312:9: sparse: got unsigned char *
fs/pstore/ram_core.c:452:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *va @@ got void [noderef] __iomem * @@
fs/pstore/ram_core.c:452:20: sparse: expected void *va
fs/pstore/ram_core.c:452:20: sparse: got void [noderef] __iomem *
fs/pstore/ram_core.c:454:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *va @@ got void [noderef] __iomem * @@
fs/pstore/ram_core.c:454:20: sparse: expected void *va
fs/pstore/ram_core.c:454:20: sparse: got void [noderef] __iomem *
>> fs/pstore/ram_core.c:542:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *iomem_cookie @@ got void *vaddr @@
>> fs/pstore/ram_core.c:542:36: sparse: expected void volatile [noderef] __iomem *iomem_cookie
fs/pstore/ram_core.c:542:36: sparse: got void *vaddr
fs/pstore/ram_core.c:69:17: sparse: sparse: context imbalance in 'buffer_start_add' - unexpected unlock
fs/pstore/ram_core.c:95:17: sparse: sparse: context imbalance in 'buffer_size_add' - unexpected unlock
--
drivers/video/fbdev/aty/atyfb_base.c:475:9: sparse: sparse: switch with no cases
>> drivers/video/fbdev/aty/atyfb_base.c:3715:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *iomem_cookie @@ got unsigned char [usertype] *addr @@
>> drivers/video/fbdev/aty/atyfb_base.c:3715:37: sparse: expected void volatile [noderef] __iomem *iomem_cookie
drivers/video/fbdev/aty/atyfb_base.c:3715:37: sparse: got unsigned char [usertype] *addr
--
drivers/gpu/drm/ttm/ttm_bo_util.c:219:30: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *[assigned] addr @@ got void [noderef] __iomem * @@
drivers/gpu/drm/ttm/ttm_bo_util.c:219:30: sparse: expected void *[assigned] addr
drivers/gpu/drm/ttm/ttm_bo_util.c:219:30: sparse: got void [noderef] __iomem *
drivers/gpu/drm/ttm/ttm_bo_util.c:221:30: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *[assigned] addr @@ got void [noderef] __iomem * @@
drivers/gpu/drm/ttm/ttm_bo_util.c:221:30: sparse: expected void *[assigned] addr
drivers/gpu/drm/ttm/ttm_bo_util.c:221:30: sparse: got void [noderef] __iomem *
drivers/gpu/drm/ttm/ttm_bo_util.c:241:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *iomem_cookie @@ got void *virtual @@
drivers/gpu/drm/ttm/ttm_bo_util.c:241:25: sparse: expected void volatile [noderef] __iomem *iomem_cookie
drivers/gpu/drm/ttm/ttm_bo_util.c:241:25: sparse: got void *virtual
>> drivers/gpu/drm/ttm/ttm_bo_util.c:256:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got unsigned int [usertype] * @@
drivers/gpu/drm/ttm/ttm_bo_util.c:256:17: sparse: expected void const [noderef] __iomem *addr
drivers/gpu/drm/ttm/ttm_bo_util.c:256:17: sparse: got unsigned int [usertype] *
drivers/gpu/drm/ttm/ttm_bo_util.c:256:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got unsigned int [usertype] * @@
drivers/gpu/drm/ttm/ttm_bo_util.c:256:17: sparse: expected void [noderef] __iomem *addr
drivers/gpu/drm/ttm/ttm_bo_util.c:256:17: sparse: got unsigned int [usertype] *
drivers/gpu/drm/ttm/ttm_bo_util.c:275:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const volatile [noderef] __iomem *from @@ got void *[assigned] src @@
drivers/gpu/drm/ttm/ttm_bo_util.c:275:9: sparse: expected void const volatile [noderef] __iomem *from
drivers/gpu/drm/ttm/ttm_bo_util.c:275:9: sparse: got void *[assigned] src
drivers/gpu/drm/ttm/ttm_bo_util.c:297:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *to @@ got void *[assigned] dst @@
drivers/gpu/drm/ttm/ttm_bo_util.c:297:9: sparse: expected void volatile [noderef] __iomem *to
drivers/gpu/drm/ttm/ttm_bo_util.c:297:9: sparse: got void *[assigned] dst
drivers/gpu/drm/ttm/ttm_bo_util.c:344:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *dst @@ got void *[addressable] new_iomap @@
drivers/gpu/drm/ttm/ttm_bo_util.c:344:17: sparse: expected void volatile [noderef] __iomem *dst
drivers/gpu/drm/ttm/ttm_bo_util.c:344:17: sparse: got void *[addressable] new_iomap
drivers/gpu/drm/ttm/ttm_bo_util.c:516:38: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *virtual @@ got void [noderef] __iomem * @@
drivers/gpu/drm/ttm/ttm_bo_util.c:516:38: sparse: expected void *virtual
drivers/gpu/drm/ttm/ttm_bo_util.c:516:38: sparse: got void [noderef] __iomem *
drivers/gpu/drm/ttm/ttm_bo_util.c:519:38: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *virtual @@ got void [noderef] __iomem * @@
drivers/gpu/drm/ttm/ttm_bo_util.c:519:38: sparse: expected void *virtual
drivers/gpu/drm/ttm/ttm_bo_util.c:519:38: sparse: got void [noderef] __iomem *
drivers/gpu/drm/ttm/ttm_bo_util.c:608:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *iomem_cookie @@ got void *virtual @@
drivers/gpu/drm/ttm/ttm_bo_util.c:608:28: sparse: expected void volatile [noderef] __iomem *iomem_cookie
drivers/gpu/drm/ttm/ttm_bo_util.c:608:28: sparse: got void *virtual
--
>> drivers/watchdog/ixp4xx_wdt.c:45:10: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/ixp4xx_wdt.c:46:10: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/ixp4xx_wdt.c:47:10: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/ixp4xx_wdt.c:48:10: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/ixp4xx_wdt.c:49:10: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/ixp4xx_wdt.c:56:10: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/ixp4xx_wdt.c:57:10: sparse: sparse: cast removes address space '__iomem' of expression
drivers/watchdog/ixp4xx_wdt.c:58:10: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/watchdog/ixp4xx_wdt.c:84:37: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char const [noderef] __user *register __p @@ got char const * @@
>> drivers/watchdog/ixp4xx_wdt.c:84:37: sparse: expected char const [noderef] __user *register __p
drivers/watchdog/ixp4xx_wdt.c:84:37: sparse: got char const *
>> drivers/watchdog/ixp4xx_wdt.c:110:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *to @@ got struct watchdog_info * @@
>> drivers/watchdog/ixp4xx_wdt.c:110:37: sparse: expected void [noderef] __user *to
drivers/watchdog/ixp4xx_wdt.c:110:37: sparse: got struct watchdog_info *
>> drivers/watchdog/ixp4xx_wdt.c:115:23: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const [noderef] __user *__pu_ptr @@ got int * @@
>> drivers/watchdog/ixp4xx_wdt.c:115:23: sparse: expected int const [noderef] __user *__pu_ptr
drivers/watchdog/ixp4xx_wdt.c:115:23: sparse: got int *
drivers/watchdog/ixp4xx_wdt.c:119:23: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const [noderef] __user *__pu_ptr @@ got int * @@
drivers/watchdog/ixp4xx_wdt.c:119:23: sparse: expected int const [noderef] __user *__pu_ptr
drivers/watchdog/ixp4xx_wdt.c:119:23: sparse: got int *
>> drivers/watchdog/ixp4xx_wdt.c:128:23: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int [noderef] __user *register __p @@ got int * @@
>> drivers/watchdog/ixp4xx_wdt.c:128:23: sparse: expected int [noderef] __user *register __p
drivers/watchdog/ixp4xx_wdt.c:128:23: sparse: got int *
drivers/watchdog/ixp4xx_wdt.c:142:23: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const [noderef] __user *__pu_ptr @@ got int * @@
drivers/watchdog/ixp4xx_wdt.c:142:23: sparse: expected int const [noderef] __user *__pu_ptr
drivers/watchdog/ixp4xx_wdt.c:142:23: sparse: got int *
drivers/watchdog/ixp4xx_wdt.c:164:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@ expected int ( *write )( ... ) @@ got int ( * )( ... ) @@
drivers/watchdog/ixp4xx_wdt.c:164:27: sparse: expected int ( *write )( ... )
drivers/watchdog/ixp4xx_wdt.c:164:27: sparse: got int ( * )( ... )
drivers/watchdog/ixp4xx_wdt.c:194:25: sparse: sparse: cast removes address space '__iomem' of expression
--
drivers/gpu/drm/qxl/qxl_kms.c:36:5: sparse: sparse: symbol 'qxl_log_level' was not declared. Should it be static?
drivers/gpu/drm/qxl/qxl_kms.c:170:19: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct qxl_rom *rom @@ got void [noderef] __iomem * @@
drivers/gpu/drm/qxl/qxl_kms.c:170:19: sparse: expected struct qxl_rom *rom
drivers/gpu/drm/qxl/qxl_kms.c:170:19: sparse: got void [noderef] __iomem *
drivers/gpu/drm/qxl/qxl_kms.c:188:26: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct qxl_ram_header *ram_header @@ got void [noderef] __iomem * @@
drivers/gpu/drm/qxl/qxl_kms.c:188:26: sparse: expected struct qxl_ram_header *ram_header
drivers/gpu/drm/qxl/qxl_kms.c:188:26: sparse: got void [noderef] __iomem *
>> drivers/gpu/drm/qxl/qxl_kms.c:277:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *iomem_cookie @@ got struct qxl_ram_header *ram_header @@
>> drivers/gpu/drm/qxl/qxl_kms.c:277:21: sparse: expected void volatile [noderef] __iomem *iomem_cookie
drivers/gpu/drm/qxl/qxl_kms.c:277:21: sparse: got struct qxl_ram_header *ram_header
>> drivers/gpu/drm/qxl/qxl_kms.c:281:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *iomem_cookie @@ got struct qxl_rom *rom @@
drivers/gpu/drm/qxl/qxl_kms.c:281:21: sparse: expected void volatile [noderef] __iomem *iomem_cookie
drivers/gpu/drm/qxl/qxl_kms.c:281:21: sparse: got struct qxl_rom *rom
drivers/gpu/drm/qxl/qxl_kms.c:301:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *iomem_cookie @@ got struct qxl_ram_header *ram_header @@
drivers/gpu/drm/qxl/qxl_kms.c:301:21: sparse: expected void volatile [noderef] __iomem *iomem_cookie
drivers/gpu/drm/qxl/qxl_kms.c:301:21: sparse: got struct qxl_ram_header *ram_header
drivers/gpu/drm/qxl/qxl_kms.c:302:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *iomem_cookie @@ got struct qxl_rom *rom @@
drivers/gpu/drm/qxl/qxl_kms.c:302:21: sparse: expected void volatile [noderef] __iomem *iomem_cookie
drivers/gpu/drm/qxl/qxl_kms.c:302:21: sparse: got struct qxl_rom *rom
--
>> drivers/leds/leds-fsg.c:147:26: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/leds/leds-fsg.c:147:23: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected short [noderef] __iomem *static [toplevel] latch_address @@ got unsigned short * @@
>> drivers/leds/leds-fsg.c:147:23: sparse: expected short [noderef] __iomem *static [toplevel] latch_address
drivers/leds/leds-fsg.c:147:23: sparse: got unsigned short *
drivers/leds/leds-fsg.c:37:18: sparse: sparse: dereference of noderef expression
drivers/leds/leds-fsg.c:40:18: sparse: sparse: dereference of noderef expression
drivers/leds/leds-fsg.c:49:18: sparse: sparse: dereference of noderef expression
drivers/leds/leds-fsg.c:52:18: sparse: sparse: dereference of noderef expression
drivers/leds/leds-fsg.c:61:18: sparse: sparse: dereference of noderef expression
drivers/leds/leds-fsg.c:64:18: sparse: sparse: dereference of noderef expression
drivers/leds/leds-fsg.c:73:18: sparse: sparse: dereference of noderef expression
drivers/leds/leds-fsg.c:76:18: sparse: sparse: dereference of noderef expression
drivers/leds/leds-fsg.c:85:18: sparse: sparse: dereference of noderef expression
drivers/leds/leds-fsg.c:88:18: sparse: sparse: dereference of noderef expression
drivers/leds/leds-fsg.c:97:18: sparse: sparse: dereference of noderef expression
drivers/leds/leds-fsg.c:100:18: sparse: sparse: dereference of noderef expression
drivers/leds/leds-fsg.c:153:10: sparse: sparse: dereference of noderef expression
vim +1075 drivers/pci/switch/switchtec.c
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 936
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 937 static u32 __iomem *event_hdr_addr(struct switchtec_dev *stdev,
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 938 int event_id, int index)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 939 {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 940 size_t off;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 941
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 942 if (event_id < 0 || event_id >= SWITCHTEC_IOCTL_MAX_EVENTS)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 943 return ERR_PTR(-EINVAL);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 944
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 945 off = event_regs[event_id].offset;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 946
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 947 if (event_regs[event_id].map_reg == part_ev_reg) {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 948 if (index == SWITCHTEC_IOCTL_EVENT_LOCAL_PART_IDX)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 949 index = stdev->partition;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 950 else if (index < 0 || index >= stdev->partition_count)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 951 return ERR_PTR(-EINVAL);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 952 } else if (event_regs[event_id].map_reg == pff_ev_reg) {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 953 if (index < 0 || index >= stdev->pff_csr_count)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 @954 return ERR_PTR(-EINVAL);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 955 }
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 956
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 957 return event_regs[event_id].map_reg(stdev, off, index);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 958 }
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 959
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 960 static int event_ctl(struct switchtec_dev *stdev,
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 961 struct switchtec_ioctl_event_ctl *ctl)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 962 {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 963 int i;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 964 u32 __iomem *reg;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 965 u32 hdr;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 966
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 967 reg = event_hdr_addr(stdev, ctl->event_id, ctl->index);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 968 if (IS_ERR(reg))
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 969 return PTR_ERR(reg);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 970
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 971 hdr = ioread32(reg);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 972 for (i = 0; i < ARRAY_SIZE(ctl->data); i++)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 973 ctl->data[i] = ioread32(®[i + 1]);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 974
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 975 ctl->occurred = hdr & SWITCHTEC_EVENT_OCCURRED;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 976 ctl->count = (hdr >> 5) & 0xFF;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 977
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 978 if (!(ctl->flags & SWITCHTEC_IOCTL_EVENT_FLAG_CLEAR))
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 979 hdr &= ~SWITCHTEC_EVENT_CLEAR;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 980 if (ctl->flags & SWITCHTEC_IOCTL_EVENT_FLAG_EN_POLL)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 981 hdr |= SWITCHTEC_EVENT_EN_IRQ;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 982 if (ctl->flags & SWITCHTEC_IOCTL_EVENT_FLAG_DIS_POLL)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 983 hdr &= ~SWITCHTEC_EVENT_EN_IRQ;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 984 if (ctl->flags & SWITCHTEC_IOCTL_EVENT_FLAG_EN_LOG)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 985 hdr |= SWITCHTEC_EVENT_EN_LOG;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 986 if (ctl->flags & SWITCHTEC_IOCTL_EVENT_FLAG_DIS_LOG)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 987 hdr &= ~SWITCHTEC_EVENT_EN_LOG;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 988 if (ctl->flags & SWITCHTEC_IOCTL_EVENT_FLAG_EN_CLI)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 989 hdr |= SWITCHTEC_EVENT_EN_CLI;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 990 if (ctl->flags & SWITCHTEC_IOCTL_EVENT_FLAG_DIS_CLI)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 991 hdr &= ~SWITCHTEC_EVENT_EN_CLI;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 992 if (ctl->flags & SWITCHTEC_IOCTL_EVENT_FLAG_EN_FATAL)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 993 hdr |= SWITCHTEC_EVENT_FATAL;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 994 if (ctl->flags & SWITCHTEC_IOCTL_EVENT_FLAG_DIS_FATAL)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 995 hdr &= ~SWITCHTEC_EVENT_FATAL;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 996
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 997 if (ctl->flags)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 998 iowrite32(hdr, reg);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 999
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1000 ctl->flags = 0;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1001 if (hdr & SWITCHTEC_EVENT_EN_IRQ)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1002 ctl->flags |= SWITCHTEC_IOCTL_EVENT_FLAG_EN_POLL;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1003 if (hdr & SWITCHTEC_EVENT_EN_LOG)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1004 ctl->flags |= SWITCHTEC_IOCTL_EVENT_FLAG_EN_LOG;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1005 if (hdr & SWITCHTEC_EVENT_EN_CLI)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1006 ctl->flags |= SWITCHTEC_IOCTL_EVENT_FLAG_EN_CLI;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1007 if (hdr & SWITCHTEC_EVENT_FATAL)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1008 ctl->flags |= SWITCHTEC_IOCTL_EVENT_FLAG_EN_FATAL;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1009
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1010 return 0;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1011 }
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1012
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1013 static int ioctl_event_ctl(struct switchtec_dev *stdev,
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1014 struct switchtec_ioctl_event_ctl __user *uctl)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1015 {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1016 int ret;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1017 int nr_idxs;
e4a7dca5de6250 Joey Zhang 2018-12-10 1018 unsigned int event_flags;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1019 struct switchtec_ioctl_event_ctl ctl;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1020
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1021 if (copy_from_user(&ctl, uctl, sizeof(ctl)))
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1022 return -EFAULT;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1023
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1024 if (ctl.event_id >= SWITCHTEC_IOCTL_MAX_EVENTS)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1025 return -EINVAL;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1026
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1027 if (ctl.flags & SWITCHTEC_IOCTL_EVENT_FLAG_UNUSED)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1028 return -EINVAL;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1029
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1030 if (ctl.index == SWITCHTEC_IOCTL_EVENT_IDX_ALL) {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1031 if (event_regs[ctl.event_id].map_reg == global_ev_reg)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1032 nr_idxs = 1;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1033 else if (event_regs[ctl.event_id].map_reg == part_ev_reg)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1034 nr_idxs = stdev->partition_count;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1035 else if (event_regs[ctl.event_id].map_reg == pff_ev_reg)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1036 nr_idxs = stdev->pff_csr_count;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1037 else
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1038 return -EINVAL;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1039
e4a7dca5de6250 Joey Zhang 2018-12-10 1040 event_flags = ctl.flags;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1041 for (ctl.index = 0; ctl.index < nr_idxs; ctl.index++) {
e4a7dca5de6250 Joey Zhang 2018-12-10 1042 ctl.flags = event_flags;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1043 ret = event_ctl(stdev, &ctl);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1044 if (ret < 0)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1045 return ret;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1046 }
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1047 } else {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1048 ret = event_ctl(stdev, &ctl);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1049 if (ret < 0)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1050 return ret;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1051 }
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1052
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1053 if (copy_to_user(uctl, &ctl, sizeof(ctl)))
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1054 return -EFAULT;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1055
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1056 return 0;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1057 }
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1058
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1059 static int ioctl_pff_to_port(struct switchtec_dev *stdev,
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1060 struct switchtec_ioctl_pff_port *up)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1061 {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1062 int i, part;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1063 u32 reg;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1064 struct part_cfg_regs *pcfg;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1065 struct switchtec_ioctl_pff_port p;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1066
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1067 if (copy_from_user(&p, up, sizeof(p)))
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1068 return -EFAULT;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1069
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1070 p.port = -1;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1071 for (part = 0; part < stdev->partition_count; part++) {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1072 pcfg = &stdev->mmio_part_cfg_all[part];
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1073 p.partition = part;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1074
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 @1075 reg = ioread32(&pcfg->usp_pff_inst_id);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1076 if (reg == p.pff) {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1077 p.port = 0;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1078 break;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1079 }
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1080
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1081 reg = ioread32(&pcfg->vep_pff_inst_id);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1082 if (reg == p.pff) {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1083 p.port = SWITCHTEC_IOCTL_PFF_VEP;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1084 break;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1085 }
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1086
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1087 for (i = 0; i < ARRAY_SIZE(pcfg->dsp_pff_inst_id); i++) {
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1088 reg = ioread32(&pcfg->dsp_pff_inst_id[i]);
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1089 if (reg != p.pff)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1090 continue;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1091
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1092 p.port = i + 1;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1093 break;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1094 }
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1095
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1096 if (p.port != -1)
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1097 break;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1098 }
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1099
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1100 if (copy_to_user(up, &p, sizeof(p)))
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1101 return -EFAULT;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1102
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1103 return 0;
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1104 }
52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1105
:::::: The code at line 1075 was first introduced by commit
:::::: 52eabba5bcdb2853dec6ef007ba427b092034738 switchtec: Add IOCTLs to the Switchtec driver
:::::: TO: Logan Gunthorpe <logang@xxxxxxxxxxxx>
:::::: CC: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip