linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [helgaas-pci:pci/driver 17/24] drivers/misc/cxl/guest.c:34:29: sparse: sparse: incorrect type in assignment (different modifiers)
@ 2021-11-12 10:43 kernel test robot
  2021-11-12 13:44 ` Krzysztof Wilczyński
  0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2021-11-12 10:43 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: kbuild-all, linux-pci

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/driver
head:   0508b6f72f055b88df518db4f3811bda9bb35da4
commit: 115c9d41e58388415f4956d0a988c90fb48663b9 [17/24] cxl: Factor out common dev->driver expressions
config: powerpc64-randconfig-s032-20211025 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 11.2.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-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?id=115c9d41e58388415f4956d0a988c90fb48663b9
        git remote add helgaas-pci https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
        git fetch --no-tags helgaas-pci pci/driver
        git checkout 115c9d41e58388415f4956d0a988c90fb48663b9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc64 

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/misc/cxl/guest.c:34:29: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
   drivers/misc/cxl/guest.c:34:29: sparse:     expected struct pci_error_handlers *err_handler
   drivers/misc/cxl/guest.c:34:29: sparse:     got struct pci_error_handlers const *err_handler
   drivers/misc/cxl/guest.c:108:33: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] phys_addr @@     got restricted __be64 [usertype] @@
   drivers/misc/cxl/guest.c:108:33: sparse:     expected unsigned long long [usertype] phys_addr
   drivers/misc/cxl/guest.c:108:33: sparse:     got restricted __be64 [usertype]
   drivers/misc/cxl/guest.c:109:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] len @@     got restricted __be64 [usertype] @@
   drivers/misc/cxl/guest.c:109:27: sparse:     expected unsigned long long [usertype] len
   drivers/misc/cxl/guest.c:109:27: sparse:     got restricted __be64 [usertype]
   drivers/misc/cxl/guest.c:111:35: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] len @@     got restricted __be64 [usertype] @@
   drivers/misc/cxl/guest.c:111:35: sparse:     expected unsigned long long [usertype] len
   drivers/misc/cxl/guest.c:111:35: sparse:     got restricted __be64 [usertype]
   drivers/misc/cxl/guest.c:443:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned short const volatile [noderef] [usertype] __iomem *addr @@     got unsigned short [usertype] * @@
   drivers/misc/cxl/guest.c:443:33: sparse:     expected unsigned short const volatile [noderef] [usertype] __iomem *addr
   drivers/misc/cxl/guest.c:443:33: sparse:     got unsigned short [usertype] *
   drivers/misc/cxl/guest.c:446:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned int const volatile [noderef] [usertype] __iomem *addr @@     got unsigned int * @@
   drivers/misc/cxl/guest.c:446:33: sparse:     expected unsigned int const volatile [noderef] [usertype] __iomem *addr
   drivers/misc/cxl/guest.c:446:33: sparse:     got unsigned int *
   drivers/misc/cxl/guest.c:449:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned long long const volatile [noderef] [usertype] __iomem *addr @@     got unsigned long long [usertype] * @@
   drivers/misc/cxl/guest.c:449:33: sparse:     expected unsigned long long const volatile [noderef] [usertype] __iomem *addr
   drivers/misc/cxl/guest.c:449:33: sparse:     got unsigned long long [usertype] *
   drivers/misc/cxl/guest.c:537:23: sparse: sparse: invalid assignment: |=
   drivers/misc/cxl/guest.c:537:23: sparse:    left side has type restricted __be64
   drivers/misc/cxl/guest.c:537:23: sparse:    right side has type unsigned long long
   drivers/misc/cxl/guest.c:538:23: sparse: sparse: invalid assignment: |=
   drivers/misc/cxl/guest.c:538:23: sparse:    left side has type restricted __be64
   drivers/misc/cxl/guest.c:538:23: sparse:    right side has type unsigned long long
   drivers/misc/cxl/guest.c:540:31: sparse: sparse: invalid assignment: |=
   drivers/misc/cxl/guest.c:540:31: sparse:    left side has type restricted __be64
   drivers/misc/cxl/guest.c:540:31: sparse:    right side has type unsigned long long
   drivers/misc/cxl/guest.c:543:23: sparse: sparse: invalid assignment: |=
   drivers/misc/cxl/guest.c:543:23: sparse:    left side has type restricted __be64
   drivers/misc/cxl/guest.c:543:23: sparse:    right side has type unsigned long long
   drivers/misc/cxl/guest.c:544:23: sparse: sparse: invalid assignment: |=
   drivers/misc/cxl/guest.c:544:23: sparse:    left side has type restricted __be64
   drivers/misc/cxl/guest.c:544:23: sparse:    right side has type unsigned long long
   drivers/misc/cxl/guest.c:546:31: sparse: sparse: invalid assignment: |=
   drivers/misc/cxl/guest.c:546:31: sparse:    left side has type restricted __be64
   drivers/misc/cxl/guest.c:546:31: sparse:    right side has type unsigned long long
   drivers/misc/cxl/guest.c:549:31: sparse: sparse: invalid assignment: |=
   drivers/misc/cxl/guest.c:549:31: sparse:    left side has type restricted __be64
   drivers/misc/cxl/guest.c:549:31: sparse:    right side has type unsigned long long
   drivers/misc/cxl/guest.c:552:31: sparse: sparse: cast from restricted __be64
--
>> drivers/misc/cxl/pci.c:1816:29: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
   drivers/misc/cxl/pci.c:1816:29: sparse:     expected struct pci_error_handlers *err_handler
   drivers/misc/cxl/pci.c:1816:29: sparse:     got struct pci_error_handlers const *err_handler
   drivers/misc/cxl/pci.c:2041:37: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
   drivers/misc/cxl/pci.c:2041:37: sparse:     expected struct pci_error_handlers *err_handler
   drivers/misc/cxl/pci.c:2041:37: sparse:     got struct pci_error_handlers const *err_handler
   drivers/misc/cxl/pci.c:2090:37: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
   drivers/misc/cxl/pci.c:2090:37: sparse:     expected struct pci_error_handlers *err_handler
   drivers/misc/cxl/pci.c:2090:37: sparse:     got struct pci_error_handlers const *err_handler

vim +34 drivers/misc/cxl/guest.c

    17	
    18	static void pci_error_handlers(struct cxl_afu *afu,
    19					int bus_error_event,
    20					pci_channel_state_t state)
    21	{
    22		struct pci_dev *afu_dev;
    23		struct pci_driver *afu_drv;
    24		struct pci_error_handlers *err_handler;
    25	
    26		if (afu->phb == NULL)
    27			return;
    28	
    29		list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) {
    30			afu_drv = afu_dev->driver;
    31			if (!afu_drv)
    32				continue;
    33	
  > 34			err_handler = afu_drv->err_handler;
    35			switch (bus_error_event) {
    36			case CXL_ERROR_DETECTED_EVENT:
    37				afu_dev->error_state = state;
    38	
    39				if (err_handler &&
    40				    err_handler->error_detected)
    41					err_handler->error_detected(afu_dev, state);
    42				break;
    43			case CXL_SLOT_RESET_EVENT:
    44				afu_dev->error_state = state;
    45	
    46				if (err_handler &&
    47				    err_handler->slot_reset)
    48					err_handler->slot_reset(afu_dev);
    49				break;
    50			case CXL_RESUME_EVENT:
    51				if (err_handler &&
    52				    err_handler->resume)
    53					err_handler->resume(afu_dev);
    54				break;
    55			}
    56		}
    57	}
    58	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36585 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [helgaas-pci:pci/driver 17/24] drivers/misc/cxl/guest.c:34:29: sparse: sparse: incorrect type in assignment (different modifiers)
  2021-11-12 10:43 [helgaas-pci:pci/driver 17/24] drivers/misc/cxl/guest.c:34:29: sparse: sparse: incorrect type in assignment (different modifiers) kernel test robot
@ 2021-11-12 13:44 ` Krzysztof Wilczyński
  2021-11-12 15:50   ` Dan Williams
  2021-11-17  7:29   ` Frederic Barrat
  0 siblings, 2 replies; 5+ messages in thread
From: Krzysztof Wilczyński @ 2021-11-12 13:44 UTC (permalink / raw)
  To: kernel test robot
  Cc: Bjorn Helgaas, kbuild-all, linux-pci, Jonathan Cameron,
	Dan Williams, Frederic Barrat, Andrew Donnellan

[+CC Adding Jonathan, Dan, Frederic and Andrew for visibility]

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/driver
> head:   0508b6f72f055b88df518db4f3811bda9bb35da4
> commit: 115c9d41e58388415f4956d0a988c90fb48663b9 [17/24] cxl: Factor out common dev->driver expressions
> config: powerpc64-randconfig-s032-20211025 (attached as .config)
> compiler: powerpc64-linux-gcc (GCC) 11.2.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-dirty
>         # https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?id=115c9d41e58388415f4956d0a988c90fb48663b9
>         git remote add helgaas-pci https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
>         git fetch --no-tags helgaas-pci pci/driver
>         git checkout 115c9d41e58388415f4956d0a988c90fb48663b9
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc64 
> 
> 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/misc/cxl/guest.c:34:29: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
>    drivers/misc/cxl/guest.c:34:29: sparse:     expected struct pci_error_handlers *err_handler
>    drivers/misc/cxl/guest.c:34:29: sparse:     got struct pci_error_handlers const *err_handler
>    drivers/misc/cxl/guest.c:108:33: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] phys_addr @@     got restricted __be64 [usertype] @@
>    drivers/misc/cxl/guest.c:108:33: sparse:     expected unsigned long long [usertype] phys_addr
>    drivers/misc/cxl/guest.c:108:33: sparse:     got restricted __be64 [usertype]
>    drivers/misc/cxl/guest.c:109:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] len @@     got restricted __be64 [usertype] @@
>    drivers/misc/cxl/guest.c:109:27: sparse:     expected unsigned long long [usertype] len
>    drivers/misc/cxl/guest.c:109:27: sparse:     got restricted __be64 [usertype]
>    drivers/misc/cxl/guest.c:111:35: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] len @@     got restricted __be64 [usertype] @@
>    drivers/misc/cxl/guest.c:111:35: sparse:     expected unsigned long long [usertype] len
>    drivers/misc/cxl/guest.c:111:35: sparse:     got restricted __be64 [usertype]
>    drivers/misc/cxl/guest.c:443:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned short const volatile [noderef] [usertype] __iomem *addr @@     got unsigned short [usertype] * @@
>    drivers/misc/cxl/guest.c:443:33: sparse:     expected unsigned short const volatile [noderef] [usertype] __iomem *addr
>    drivers/misc/cxl/guest.c:443:33: sparse:     got unsigned short [usertype] *
>    drivers/misc/cxl/guest.c:446:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned int const volatile [noderef] [usertype] __iomem *addr @@     got unsigned int * @@
>    drivers/misc/cxl/guest.c:446:33: sparse:     expected unsigned int const volatile [noderef] [usertype] __iomem *addr
>    drivers/misc/cxl/guest.c:446:33: sparse:     got unsigned int *
>    drivers/misc/cxl/guest.c:449:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned long long const volatile [noderef] [usertype] __iomem *addr @@     got unsigned long long [usertype] * @@
>    drivers/misc/cxl/guest.c:449:33: sparse:     expected unsigned long long const volatile [noderef] [usertype] __iomem *addr
>    drivers/misc/cxl/guest.c:449:33: sparse:     got unsigned long long [usertype] *
>    drivers/misc/cxl/guest.c:537:23: sparse: sparse: invalid assignment: |=
>    drivers/misc/cxl/guest.c:537:23: sparse:    left side has type restricted __be64
>    drivers/misc/cxl/guest.c:537:23: sparse:    right side has type unsigned long long
>    drivers/misc/cxl/guest.c:538:23: sparse: sparse: invalid assignment: |=
>    drivers/misc/cxl/guest.c:538:23: sparse:    left side has type restricted __be64
>    drivers/misc/cxl/guest.c:538:23: sparse:    right side has type unsigned long long
>    drivers/misc/cxl/guest.c:540:31: sparse: sparse: invalid assignment: |=
>    drivers/misc/cxl/guest.c:540:31: sparse:    left side has type restricted __be64
>    drivers/misc/cxl/guest.c:540:31: sparse:    right side has type unsigned long long
>    drivers/misc/cxl/guest.c:543:23: sparse: sparse: invalid assignment: |=
>    drivers/misc/cxl/guest.c:543:23: sparse:    left side has type restricted __be64
>    drivers/misc/cxl/guest.c:543:23: sparse:    right side has type unsigned long long
>    drivers/misc/cxl/guest.c:544:23: sparse: sparse: invalid assignment: |=
>    drivers/misc/cxl/guest.c:544:23: sparse:    left side has type restricted __be64
>    drivers/misc/cxl/guest.c:544:23: sparse:    right side has type unsigned long long
>    drivers/misc/cxl/guest.c:546:31: sparse: sparse: invalid assignment: |=
>    drivers/misc/cxl/guest.c:546:31: sparse:    left side has type restricted __be64
>    drivers/misc/cxl/guest.c:546:31: sparse:    right side has type unsigned long long
>    drivers/misc/cxl/guest.c:549:31: sparse: sparse: invalid assignment: |=
>    drivers/misc/cxl/guest.c:549:31: sparse:    left side has type restricted __be64
>    drivers/misc/cxl/guest.c:549:31: sparse:    right side has type unsigned long long
>    drivers/misc/cxl/guest.c:552:31: sparse: sparse: cast from restricted __be64
> --
> >> drivers/misc/cxl/pci.c:1816:29: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
>    drivers/misc/cxl/pci.c:1816:29: sparse:     expected struct pci_error_handlers *err_handler
>    drivers/misc/cxl/pci.c:1816:29: sparse:     got struct pci_error_handlers const *err_handler
>    drivers/misc/cxl/pci.c:2041:37: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
>    drivers/misc/cxl/pci.c:2041:37: sparse:     expected struct pci_error_handlers *err_handler
>    drivers/misc/cxl/pci.c:2041:37: sparse:     got struct pci_error_handlers const *err_handler
>    drivers/misc/cxl/pci.c:2090:37: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
>    drivers/misc/cxl/pci.c:2090:37: sparse:     expected struct pci_error_handlers *err_handler
>    drivers/misc/cxl/pci.c:2090:37: sparse:     got struct pci_error_handlers const *err_handler
> 
> vim +34 drivers/misc/cxl/guest.c
> 
>     17	
>     18	static void pci_error_handlers(struct cxl_afu *afu,
>     19					int bus_error_event,
>     20					pci_channel_state_t state)
>     21	{
>     22		struct pci_dev *afu_dev;
>     23		struct pci_driver *afu_drv;
>     24		struct pci_error_handlers *err_handler;
>     25	
>     26		if (afu->phb == NULL)
>     27			return;
>     28	
>     29		list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) {
>     30			afu_drv = afu_dev->driver;
>     31			if (!afu_drv)
>     32				continue;
>     33	
>   > 34			err_handler = afu_drv->err_handler;
>     35			switch (bus_error_event) {
>     36			case CXL_ERROR_DETECTED_EVENT:
>     37				afu_dev->error_state = state;
>     38	
>     39				if (err_handler &&
>     40				    err_handler->error_detected)
>     41					err_handler->error_detected(afu_dev, state);
>     42				break;
>     43			case CXL_SLOT_RESET_EVENT:
>     44				afu_dev->error_state = state;
>     45	
>     46				if (err_handler &&
>     47				    err_handler->slot_reset)
>     48					err_handler->slot_reset(afu_dev);
>     49				break;
>     50			case CXL_RESUME_EVENT:
>     51				if (err_handler &&
>     52				    err_handler->resume)
>     53					err_handler->resume(afu_dev);
>     54				break;
>     55			}
>     56		}
>     57	}
>     58	

	Krzysztof

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [helgaas-pci:pci/driver 17/24] drivers/misc/cxl/guest.c:34:29: sparse: sparse: incorrect type in assignment (different modifiers)
  2021-11-12 13:44 ` Krzysztof Wilczyński
@ 2021-11-12 15:50   ` Dan Williams
  2021-11-12 18:29     ` Krzysztof Wilczyński
  2021-11-17  7:29   ` Frederic Barrat
  1 sibling, 1 reply; 5+ messages in thread
From: Dan Williams @ 2021-11-12 15:50 UTC (permalink / raw)
  To: Krzysztof Wilczyński
  Cc: kernel test robot, Bjorn Helgaas, kbuild-all, Linux PCI,
	Jonathan Cameron, Frederic Barrat, Andrew Donnellan

On Fri, Nov 12, 2021 at 5:45 AM Krzysztof Wilczyński <kw@linux.com> wrote:
>
> [+CC Adding Jonathan, Dan, Frederic and Andrew for visibility]

Note that drivers/misc/cxl/ != drivers/cxl/

The former is CAPI Accelerator Link (?), and the latter is Compute Express Link.

>
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/driver
> > head:   0508b6f72f055b88df518db4f3811bda9bb35da4
> > commit: 115c9d41e58388415f4956d0a988c90fb48663b9 [17/24] cxl: Factor out common dev->driver expressions
> > config: powerpc64-randconfig-s032-20211025 (attached as .config)
> > compiler: powerpc64-linux-gcc (GCC) 11.2.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-dirty
> >         # https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?id=115c9d41e58388415f4956d0a988c90fb48663b9
> >         git remote add helgaas-pci https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
> >         git fetch --no-tags helgaas-pci pci/driver
> >         git checkout 115c9d41e58388415f4956d0a988c90fb48663b9
> >         # save the attached .config to linux build tree
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc64
> >
> > 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/misc/cxl/guest.c:34:29: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
> >    drivers/misc/cxl/guest.c:34:29: sparse:     expected struct pci_error_handlers *err_handler
> >    drivers/misc/cxl/guest.c:34:29: sparse:     got struct pci_error_handlers const *err_handler
> >    drivers/misc/cxl/guest.c:108:33: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] phys_addr @@     got restricted __be64 [usertype] @@
> >    drivers/misc/cxl/guest.c:108:33: sparse:     expected unsigned long long [usertype] phys_addr
> >    drivers/misc/cxl/guest.c:108:33: sparse:     got restricted __be64 [usertype]
> >    drivers/misc/cxl/guest.c:109:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] len @@     got restricted __be64 [usertype] @@
> >    drivers/misc/cxl/guest.c:109:27: sparse:     expected unsigned long long [usertype] len
> >    drivers/misc/cxl/guest.c:109:27: sparse:     got restricted __be64 [usertype]
> >    drivers/misc/cxl/guest.c:111:35: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] len @@     got restricted __be64 [usertype] @@
> >    drivers/misc/cxl/guest.c:111:35: sparse:     expected unsigned long long [usertype] len
> >    drivers/misc/cxl/guest.c:111:35: sparse:     got restricted __be64 [usertype]
> >    drivers/misc/cxl/guest.c:443:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned short const volatile [noderef] [usertype] __iomem *addr @@     got unsigned short [usertype] * @@
> >    drivers/misc/cxl/guest.c:443:33: sparse:     expected unsigned short const volatile [noderef] [usertype] __iomem *addr
> >    drivers/misc/cxl/guest.c:443:33: sparse:     got unsigned short [usertype] *
> >    drivers/misc/cxl/guest.c:446:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned int const volatile [noderef] [usertype] __iomem *addr @@     got unsigned int * @@
> >    drivers/misc/cxl/guest.c:446:33: sparse:     expected unsigned int const volatile [noderef] [usertype] __iomem *addr
> >    drivers/misc/cxl/guest.c:446:33: sparse:     got unsigned int *
> >    drivers/misc/cxl/guest.c:449:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned long long const volatile [noderef] [usertype] __iomem *addr @@     got unsigned long long [usertype] * @@
> >    drivers/misc/cxl/guest.c:449:33: sparse:     expected unsigned long long const volatile [noderef] [usertype] __iomem *addr
> >    drivers/misc/cxl/guest.c:449:33: sparse:     got unsigned long long [usertype] *
> >    drivers/misc/cxl/guest.c:537:23: sparse: sparse: invalid assignment: |=
> >    drivers/misc/cxl/guest.c:537:23: sparse:    left side has type restricted __be64
> >    drivers/misc/cxl/guest.c:537:23: sparse:    right side has type unsigned long long
> >    drivers/misc/cxl/guest.c:538:23: sparse: sparse: invalid assignment: |=
> >    drivers/misc/cxl/guest.c:538:23: sparse:    left side has type restricted __be64
> >    drivers/misc/cxl/guest.c:538:23: sparse:    right side has type unsigned long long
> >    drivers/misc/cxl/guest.c:540:31: sparse: sparse: invalid assignment: |=
> >    drivers/misc/cxl/guest.c:540:31: sparse:    left side has type restricted __be64
> >    drivers/misc/cxl/guest.c:540:31: sparse:    right side has type unsigned long long
> >    drivers/misc/cxl/guest.c:543:23: sparse: sparse: invalid assignment: |=
> >    drivers/misc/cxl/guest.c:543:23: sparse:    left side has type restricted __be64
> >    drivers/misc/cxl/guest.c:543:23: sparse:    right side has type unsigned long long
> >    drivers/misc/cxl/guest.c:544:23: sparse: sparse: invalid assignment: |=
> >    drivers/misc/cxl/guest.c:544:23: sparse:    left side has type restricted __be64
> >    drivers/misc/cxl/guest.c:544:23: sparse:    right side has type unsigned long long
> >    drivers/misc/cxl/guest.c:546:31: sparse: sparse: invalid assignment: |=
> >    drivers/misc/cxl/guest.c:546:31: sparse:    left side has type restricted __be64
> >    drivers/misc/cxl/guest.c:546:31: sparse:    right side has type unsigned long long
> >    drivers/misc/cxl/guest.c:549:31: sparse: sparse: invalid assignment: |=
> >    drivers/misc/cxl/guest.c:549:31: sparse:    left side has type restricted __be64
> >    drivers/misc/cxl/guest.c:549:31: sparse:    right side has type unsigned long long
> >    drivers/misc/cxl/guest.c:552:31: sparse: sparse: cast from restricted __be64
> > --
> > >> drivers/misc/cxl/pci.c:1816:29: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
> >    drivers/misc/cxl/pci.c:1816:29: sparse:     expected struct pci_error_handlers *err_handler
> >    drivers/misc/cxl/pci.c:1816:29: sparse:     got struct pci_error_handlers const *err_handler
> >    drivers/misc/cxl/pci.c:2041:37: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
> >    drivers/misc/cxl/pci.c:2041:37: sparse:     expected struct pci_error_handlers *err_handler
> >    drivers/misc/cxl/pci.c:2041:37: sparse:     got struct pci_error_handlers const *err_handler
> >    drivers/misc/cxl/pci.c:2090:37: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
> >    drivers/misc/cxl/pci.c:2090:37: sparse:     expected struct pci_error_handlers *err_handler
> >    drivers/misc/cxl/pci.c:2090:37: sparse:     got struct pci_error_handlers const *err_handler
> >
> > vim +34 drivers/misc/cxl/guest.c
> >
> >     17
> >     18        static void pci_error_handlers(struct cxl_afu *afu,
> >     19                                        int bus_error_event,
> >     20                                        pci_channel_state_t state)
> >     21        {
> >     22                struct pci_dev *afu_dev;
> >     23                struct pci_driver *afu_drv;
> >     24                struct pci_error_handlers *err_handler;
> >     25
> >     26                if (afu->phb == NULL)
> >     27                        return;
> >     28
> >     29                list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) {
> >     30                        afu_drv = afu_dev->driver;
> >     31                        if (!afu_drv)
> >     32                                continue;
> >     33
> >   > 34                        err_handler = afu_drv->err_handler;
> >     35                        switch (bus_error_event) {
> >     36                        case CXL_ERROR_DETECTED_EVENT:
> >     37                                afu_dev->error_state = state;
> >     38
> >     39                                if (err_handler &&
> >     40                                    err_handler->error_detected)
> >     41                                        err_handler->error_detected(afu_dev, state);
> >     42                                break;
> >     43                        case CXL_SLOT_RESET_EVENT:
> >     44                                afu_dev->error_state = state;
> >     45
> >     46                                if (err_handler &&
> >     47                                    err_handler->slot_reset)
> >     48                                        err_handler->slot_reset(afu_dev);
> >     49                                break;
> >     50                        case CXL_RESUME_EVENT:
> >     51                                if (err_handler &&
> >     52                                    err_handler->resume)
> >     53                                        err_handler->resume(afu_dev);
> >     54                                break;
> >     55                        }
> >     56                }
> >     57        }
> >     58
>
>         Krzysztof

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [helgaas-pci:pci/driver 17/24] drivers/misc/cxl/guest.c:34:29: sparse: sparse: incorrect type in assignment (different modifiers)
  2021-11-12 15:50   ` Dan Williams
@ 2021-11-12 18:29     ` Krzysztof Wilczyński
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Wilczyński @ 2021-11-12 18:29 UTC (permalink / raw)
  To: Dan Williams
  Cc: kernel test robot, Bjorn Helgaas, kbuild-all, Linux PCI,
	Jonathan Cameron, Frederic Barrat, Andrew Donnellan

Hi Dan,

> Note that drivers/misc/cxl/ != drivers/cxl/
> 
> The former is CAPI Accelerator Link (?), and the latter is Compute Express Link.

Ah!  Got it.  Apologies for causing some commotion here then.  I simply
called upon all the resident CXL experts I could think of.

	Krzysztof

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [helgaas-pci:pci/driver 17/24] drivers/misc/cxl/guest.c:34:29: sparse: sparse: incorrect type in assignment (different modifiers)
  2021-11-12 13:44 ` Krzysztof Wilczyński
  2021-11-12 15:50   ` Dan Williams
@ 2021-11-17  7:29   ` Frederic Barrat
  1 sibling, 0 replies; 5+ messages in thread
From: Frederic Barrat @ 2021-11-17  7:29 UTC (permalink / raw)
  To: Krzysztof Wilczyński, kernel test robot
  Cc: Bjorn Helgaas, kbuild-all, linux-pci, Jonathan Cameron,
	Dan Williams, Andrew Donnellan

Hi,

It looks like this has already been taken care of? By Bjorn?

   Fred


On 12/11/2021 14:44, Krzysztof Wilczyński wrote:
> [+CC Adding Jonathan, Dan, Frederic and Andrew for visibility]
> 
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/driver
>> head:   0508b6f72f055b88df518db4f3811bda9bb35da4
>> commit: 115c9d41e58388415f4956d0a988c90fb48663b9 [17/24] cxl: Factor out common dev->driver expressions
>> config: powerpc64-randconfig-s032-20211025 (attached as .config)
>> compiler: powerpc64-linux-gcc (GCC) 11.2.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-dirty
>>          # https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?id=115c9d41e58388415f4956d0a988c90fb48663b9
>>          git remote add helgaas-pci https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
>>          git fetch --no-tags helgaas-pci pci/driver
>>          git checkout 115c9d41e58388415f4956d0a988c90fb48663b9
>>          # save the attached .config to linux build tree
>>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc64
>>
>> 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/misc/cxl/guest.c:34:29: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
>>     drivers/misc/cxl/guest.c:34:29: sparse:     expected struct pci_error_handlers *err_handler
>>     drivers/misc/cxl/guest.c:34:29: sparse:     got struct pci_error_handlers const *err_handler
>>     drivers/misc/cxl/guest.c:108:33: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] phys_addr @@     got restricted __be64 [usertype] @@
>>     drivers/misc/cxl/guest.c:108:33: sparse:     expected unsigned long long [usertype] phys_addr
>>     drivers/misc/cxl/guest.c:108:33: sparse:     got restricted __be64 [usertype]
>>     drivers/misc/cxl/guest.c:109:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] len @@     got restricted __be64 [usertype] @@
>>     drivers/misc/cxl/guest.c:109:27: sparse:     expected unsigned long long [usertype] len
>>     drivers/misc/cxl/guest.c:109:27: sparse:     got restricted __be64 [usertype]
>>     drivers/misc/cxl/guest.c:111:35: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] len @@     got restricted __be64 [usertype] @@
>>     drivers/misc/cxl/guest.c:111:35: sparse:     expected unsigned long long [usertype] len
>>     drivers/misc/cxl/guest.c:111:35: sparse:     got restricted __be64 [usertype]
>>     drivers/misc/cxl/guest.c:443:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned short const volatile [noderef] [usertype] __iomem *addr @@     got unsigned short [usertype] * @@
>>     drivers/misc/cxl/guest.c:443:33: sparse:     expected unsigned short const volatile [noderef] [usertype] __iomem *addr
>>     drivers/misc/cxl/guest.c:443:33: sparse:     got unsigned short [usertype] *
>>     drivers/misc/cxl/guest.c:446:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned int const volatile [noderef] [usertype] __iomem *addr @@     got unsigned int * @@
>>     drivers/misc/cxl/guest.c:446:33: sparse:     expected unsigned int const volatile [noderef] [usertype] __iomem *addr
>>     drivers/misc/cxl/guest.c:446:33: sparse:     got unsigned int *
>>     drivers/misc/cxl/guest.c:449:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected unsigned long long const volatile [noderef] [usertype] __iomem *addr @@     got unsigned long long [usertype] * @@
>>     drivers/misc/cxl/guest.c:449:33: sparse:     expected unsigned long long const volatile [noderef] [usertype] __iomem *addr
>>     drivers/misc/cxl/guest.c:449:33: sparse:     got unsigned long long [usertype] *
>>     drivers/misc/cxl/guest.c:537:23: sparse: sparse: invalid assignment: |=
>>     drivers/misc/cxl/guest.c:537:23: sparse:    left side has type restricted __be64
>>     drivers/misc/cxl/guest.c:537:23: sparse:    right side has type unsigned long long
>>     drivers/misc/cxl/guest.c:538:23: sparse: sparse: invalid assignment: |=
>>     drivers/misc/cxl/guest.c:538:23: sparse:    left side has type restricted __be64
>>     drivers/misc/cxl/guest.c:538:23: sparse:    right side has type unsigned long long
>>     drivers/misc/cxl/guest.c:540:31: sparse: sparse: invalid assignment: |=
>>     drivers/misc/cxl/guest.c:540:31: sparse:    left side has type restricted __be64
>>     drivers/misc/cxl/guest.c:540:31: sparse:    right side has type unsigned long long
>>     drivers/misc/cxl/guest.c:543:23: sparse: sparse: invalid assignment: |=
>>     drivers/misc/cxl/guest.c:543:23: sparse:    left side has type restricted __be64
>>     drivers/misc/cxl/guest.c:543:23: sparse:    right side has type unsigned long long
>>     drivers/misc/cxl/guest.c:544:23: sparse: sparse: invalid assignment: |=
>>     drivers/misc/cxl/guest.c:544:23: sparse:    left side has type restricted __be64
>>     drivers/misc/cxl/guest.c:544:23: sparse:    right side has type unsigned long long
>>     drivers/misc/cxl/guest.c:546:31: sparse: sparse: invalid assignment: |=
>>     drivers/misc/cxl/guest.c:546:31: sparse:    left side has type restricted __be64
>>     drivers/misc/cxl/guest.c:546:31: sparse:    right side has type unsigned long long
>>     drivers/misc/cxl/guest.c:549:31: sparse: sparse: invalid assignment: |=
>>     drivers/misc/cxl/guest.c:549:31: sparse:    left side has type restricted __be64
>>     drivers/misc/cxl/guest.c:549:31: sparse:    right side has type unsigned long long
>>     drivers/misc/cxl/guest.c:552:31: sparse: sparse: cast from restricted __be64
>> --
>>>> drivers/misc/cxl/pci.c:1816:29: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
>>     drivers/misc/cxl/pci.c:1816:29: sparse:     expected struct pci_error_handlers *err_handler
>>     drivers/misc/cxl/pci.c:1816:29: sparse:     got struct pci_error_handlers const *err_handler
>>     drivers/misc/cxl/pci.c:2041:37: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
>>     drivers/misc/cxl/pci.c:2041:37: sparse:     expected struct pci_error_handlers *err_handler
>>     drivers/misc/cxl/pci.c:2041:37: sparse:     got struct pci_error_handlers const *err_handler
>>     drivers/misc/cxl/pci.c:2090:37: sparse: sparse: incorrect type in assignment (different modifiers) @@     expected struct pci_error_handlers *err_handler @@     got struct pci_error_handlers const *err_handler @@
>>     drivers/misc/cxl/pci.c:2090:37: sparse:     expected struct pci_error_handlers *err_handler
>>     drivers/misc/cxl/pci.c:2090:37: sparse:     got struct pci_error_handlers const *err_handler
>>
>> vim +34 drivers/misc/cxl/guest.c
>>
>>      17	
>>      18	static void pci_error_handlers(struct cxl_afu *afu,
>>      19					int bus_error_event,
>>      20					pci_channel_state_t state)
>>      21	{
>>      22		struct pci_dev *afu_dev;
>>      23		struct pci_driver *afu_drv;
>>      24		struct pci_error_handlers *err_handler;
>>      25	
>>      26		if (afu->phb == NULL)
>>      27			return;
>>      28	
>>      29		list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) {
>>      30			afu_drv = afu_dev->driver;
>>      31			if (!afu_drv)
>>      32				continue;
>>      33	
>>    > 34			err_handler = afu_drv->err_handler;
>>      35			switch (bus_error_event) {
>>      36			case CXL_ERROR_DETECTED_EVENT:
>>      37				afu_dev->error_state = state;
>>      38	
>>      39				if (err_handler &&
>>      40				    err_handler->error_detected)
>>      41					err_handler->error_detected(afu_dev, state);
>>      42				break;
>>      43			case CXL_SLOT_RESET_EVENT:
>>      44				afu_dev->error_state = state;
>>      45	
>>      46				if (err_handler &&
>>      47				    err_handler->slot_reset)
>>      48					err_handler->slot_reset(afu_dev);
>>      49				break;
>>      50			case CXL_RESUME_EVENT:
>>      51				if (err_handler &&
>>      52				    err_handler->resume)
>>      53					err_handler->resume(afu_dev);
>>      54				break;
>>      55			}
>>      56		}
>>      57	}
>>      58	
> 
> 	Krzysztof
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-17  7:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12 10:43 [helgaas-pci:pci/driver 17/24] drivers/misc/cxl/guest.c:34:29: sparse: sparse: incorrect type in assignment (different modifiers) kernel test robot
2021-11-12 13:44 ` Krzysztof Wilczyński
2021-11-12 15:50   ` Dan Williams
2021-11-12 18:29     ` Krzysztof Wilczyński
2021-11-17  7:29   ` Frederic Barrat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).