From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============3674177347112760438==" MIME-Version: 1.0 From: Krzysztof Kozlowski To: kbuild-all@lists.01.org Subject: Re: [krzk-github:for-next/ioread-const-only-important-patches-v3 1/4] drivers/pci/switch/switchtec.c:1075:33: sparse: sparse: incorrect type in argument 1 (different address spaces) Date: Wed, 08 Jul 2020 09:26:36 +0200 Message-ID: <20200708072636.GA7058@kozik-lap> In-Reply-To: List-Id: --===============3674177347112760438== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Wed, Jul 08, 2020 at 09:13:27AM +0200, Arnd Bergmann wrote: > On Wed, Jul 8, 2020 at 4:52 AM kernel test robot wrote: > > > > tree: https://github.com/krzk/linux for-next/ioread-const-only-import= ant-patches-v3 > > head: 642cfec5a0b4b2c092cc803b8b2100c2bbc3b80b > > commit: 7e593a34879e675b9e9dd7903888b31e0847c12e [1/4] iomap: Constify = ioreadX() iomem argument (as in generic implementation) > > config: x86_64-randconfig-s022-20200707 (attached as .config) > > compiler: gcc-9 (Debian 9.3.0-14) 9.3.0 > > reproduce: > > # apt-get install sparse > > # sparse version: v0.6.2-31-gabbfd661-dirty > > git checkout 7e593a34879e675b9e9dd7903888b31e0847c12e > > # save the attached .config to linux build tree > > make W=3D1 C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' = ARCH=3Dx86_64 > > > > 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 typ= e 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 typ= e 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 typ= e 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 ty= pe in argument 2 (different address spaces) @@ expected void const [nod= eref] __user *from @@ got struct switchtec_ioctl_pff_port *up @@ > > drivers/pci/switch/switchtec.c:1067:32: sparse: expected void co= nst [noderef] __user *from > > drivers/pci/switch/switchtec.c:1067:32: sparse: got struct switc= htec_ioctl_pff_port *up > > drivers/pci/switch/switchtec.c:1072:22: sparse: sparse: incorrect ty= pe 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 ty= pe in argument 1 (different address spaces) @@ expected void const [nod= eref] __iomem * @@ got unsigned int * @@ > > >> drivers/pci/switch/switchtec.c:1075:33: sparse: expected void co= nst [noderef] __iomem * > > drivers/pci/switch/switchtec.c:1075:33: sparse: got unsigned int= * > = > > vim +1075 drivers/pci/switch/switchtec.c > > > > 52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1058 > > 52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1059 static int ioctl_pff_t= o_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 switchte= c_ioctl_pff_port p; > > 52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1066 > > 52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1067 if (copy_from_u= ser(&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 =3D -1; > > 52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1071 for (part =3D 0= ; part < stdev->partition_count; part++) { > > 52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1072 pcfg = =3D &stdev->mmio_part_cfg_all[part]; > > 52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1073 p.parti= tion =3D part; > > 52eabba5bcdb28 Logan Gunthorpe 2017-03-02 1074 > = > > :::::: The code at line 1075 was first introduced by commit > > :::::: 52eabba5bcdb2853dec6ef007ba427b092034738 switchtec: Add IOCTLs t= o the Switchtec driver > > > > :::::: TO: Logan Gunthorpe > > :::::: CC: Bjorn Helgaas > = > Right, this one needs an __iomem annotation on the 'pcfg' pointer. I wonder why Kernel Test Robot notifies about this code for this branch. This is a branch with only ioread-const unification. Although commits touched included header linux/io-64-nonatomic-lo-hi.h but only constness was affected. Therefore all these warnings should exist before as well. Best regards, Krzysztof --===============3674177347112760438==--