tree: https://github.com/hnaz/linux-mm master head: 2932a9e66c580f3c8d95ec27716d437198fb4c94 commit: 07b12d9b4d4dfc2f4708b795d5abeab3131278f0 [412/421] iomap: constify ioreadX() iomem argument (as in generic implementation) config: alpha-randconfig-s031-20201012 (attached as .config) compiler: alpha-linux-gcc (GCC) 9.3.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.3-rc1-dirty # https://github.com/hnaz/linux-mm/commit/07b12d9b4d4dfc2f4708b795d5abeab3131278f0 git remote add hnaz-linux-mm https://github.com/hnaz/linux-mm git fetch --no-tags hnaz-linux-mm master git checkout 07b12d9b4d4dfc2f4708b795d5abeab3131278f0 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=alpha If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot "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:33: 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:33: sparse: expected void const [noderef] __iomem *addr drivers/pci/switch/switchtec.c:1075:33: sparse: got unsigned int * drivers/pci/switch/switchtec.c:1081:33: 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:33: sparse: expected void const [noderef] __iomem *addr drivers/pci/switch/switchtec.c:1081:33: sparse: got unsigned int * drivers/pci/switch/switchtec.c:1088:62: 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:62: sparse: expected void const [noderef] __iomem *addr drivers/pci/switch/switchtec.c:1088:62: 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:35: 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:35: sparse: expected void const [noderef] __iomem *addr drivers/pci/switch/switchtec.c:1124:35: sparse: got unsigned int * drivers/pci/switch/switchtec.c:1127:35: 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:35: sparse: expected void const [noderef] __iomem *addr drivers/pci/switch/switchtec.c:1127:35: sparse: got unsigned int * drivers/pci/switch/switchtec.c:1134:56: 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:56: sparse: expected void const [noderef] __iomem *addr drivers/pci/switch/switchtec.c:1134:56: 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: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:1497:25: sparse: expected void const [noderef] __iomem *addr drivers/pci/switch/switchtec.c:1497:25: sparse: got unsigned int * drivers/pci/switch/switchtec.c:1501: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:1501:25: sparse: expected void const [noderef] __iomem *addr drivers/pci/switch/switchtec.c:1501:25: sparse: got unsigned int * drivers/pci/switch/switchtec.c:1506:54: 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:54: sparse: expected void const [noderef] __iomem *addr drivers/pci/switch/switchtec.c:1506:54: sparse: got unsigned int * vim +1075 drivers/pci/switch/switchtec.c 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1058 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1059 static int ioctl_pff_to_port(struct switchtec_dev *stdev, 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1060 struct switchtec_ioctl_pff_port *up) 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1061 { 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1062 int i, part; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1063 u32 reg; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1064 struct part_cfg_regs *pcfg; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1065 struct switchtec_ioctl_pff_port p; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1066 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1067 if (copy_from_user(&p, up, sizeof(p))) 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1068 return -EFAULT; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1069 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1070 p.port = -1; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1071 for (part = 0; part < stdev->partition_count; part++) { 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1072 pcfg = &stdev->mmio_part_cfg_all[part]; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1073 p.partition = part; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1074 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 @1075 reg = ioread32(&pcfg->usp_pff_inst_id); 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1076 if (reg == p.pff) { 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1077 p.port = 0; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1078 break; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1079 } 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1080 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1081 reg = ioread32(&pcfg->vep_pff_inst_id); 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1082 if (reg == p.pff) { 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1083 p.port = SWITCHTEC_IOCTL_PFF_VEP; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1084 break; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1085 } 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1086 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1087 for (i = 0; i < ARRAY_SIZE(pcfg->dsp_pff_inst_id); i++) { 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1088 reg = ioread32(&pcfg->dsp_pff_inst_id[i]); 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1089 if (reg != p.pff) 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1090 continue; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1091 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1092 p.port = i + 1; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1093 break; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1094 } 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1095 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1096 if (p.port != -1) 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1097 break; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1098 } 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1099 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1100 if (copy_to_user(up, &p, sizeof(p))) 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1101 return -EFAULT; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1102 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1103 return 0; 52eabba5bcdb285 Logan Gunthorpe 2017-03-02 1104 } 52eabba5bcdb285 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 :::::: CC: Bjorn Helgaas --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org