All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
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	[thread overview]
Message-ID: <20200708072636.GA7058@kozik-lap> (raw)
In-Reply-To: <CAK8P3a0QGwzbutTC5mRMN00_NmZ0GUXWnoSHg8At42HBVPQt7A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 5558 bytes --]

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 <lkp@intel.com> wrote:
> >
> > tree:   https://github.com/krzk/linux for-next/ioread-const-only-important-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=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@intel.com>
> >
> >
> > 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 * @@     got unsigned int * @@
> > >> drivers/pci/switch/switchtec.c:1075:33: sparse:     expected void const [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_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
> 
> > :::::: The code at line 1075 was first introduced by commit
> > :::::: 52eabba5bcdb2853dec6ef007ba427b092034738 switchtec: Add IOCTLs to the Switchtec driver
> >
> > :::::: TO: Logan Gunthorpe <logang@deltatee.com>
> > :::::: CC: Bjorn Helgaas <bhelgaas@google.com>
> 
> 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

  reply	other threads:[~2020-07-08  7:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08  2:52 [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) kernel test robot
2020-07-08  7:13 ` Arnd Bergmann
2020-07-08  7:26   ` Krzysztof Kozlowski [this message]
2020-07-08  7:31     ` Krzysztof Kozlowski
2020-07-08  9:01       ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200708072636.GA7058@kozik-lap \
    --to=krzk@kernel.org \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.