drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c:63:25: sparse: sparse: incorrect type in assignment (different address spaces)

From: kernel test robot
Date: Tue Jun 23 2020 - 07:13:22 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dd0d718152e4c65b173070d48ea9dfc06894c3e5
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 5 days ago
config: powerpc-randconfig-s031-20200623 (attached as .config)
compiler: powerpc-linux-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=powerpc 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/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c:63:25: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void const [noderef] __iomem *data @@ got void const * @@
>> drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c:63:25: sparse: expected void const [noderef] __iomem *data
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c:63:25: sparse: got void const *
--
drivers/gpu/drm/mgag200/mgag200_cursor.c:32:44: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __iomem * @@ got void * @@
drivers/gpu/drm/mgag200/mgag200_cursor.c:32:44: sparse: expected void [noderef] __iomem *
drivers/gpu/drm/mgag200/mgag200_cursor.c:32:44: sparse: got void *
drivers/gpu/drm/mgag200/mgag200_cursor.c:85:52: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __iomem * @@ got void * @@
drivers/gpu/drm/mgag200/mgag200_cursor.c:85:52: sparse: expected void [noderef] __iomem *
drivers/gpu/drm/mgag200/mgag200_cursor.c:85:52: sparse: got void *
>> drivers/gpu/drm/mgag200/mgag200_cursor.c:103:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *d @@ got void * @@
>> drivers/gpu/drm/mgag200/mgag200_cursor.c:103:33: sparse: expected void volatile [noderef] __iomem *d
drivers/gpu/drm/mgag200/mgag200_cursor.c:103:33: sparse: got void *
--
arch/powerpc/platforms/powermac/setup.c:74:5: sparse: sparse: symbol 'ppc_override_l2cr' was not declared. Should it be static?
arch/powerpc/platforms/powermac/setup.c:75:5: sparse: sparse: symbol 'ppc_override_l2cr_value' was not declared. Should it be static?
arch/powerpc/platforms/powermac/setup.c:76:5: sparse: sparse: symbol 'has_l2cache' was not declared. Should it be static?
>> arch/powerpc/platforms/powermac/setup.c:215:25: sparse: sparse: cast removes address space '__iomem' of expression
--
>> drivers/char/agp/uninorth-agp.c:174:15: sparse: sparse: cast removes address space '__iomem' of expression
drivers/char/agp/uninorth-agp.c:188:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] @@ got restricted __le32 [usertype] @@
drivers/char/agp/uninorth-agp.c:188:31: sparse: expected unsigned int [usertype]
drivers/char/agp/uninorth-agp.c:188:31: sparse: got restricted __le32 [usertype]
drivers/char/agp/uninorth-agp.c:217:15: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/char/agp/uninorth-agp.c:424:28: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] [usertype] __iomem *gatt_table @@ got void * @@
>> drivers/char/agp/uninorth-agp.c:424:28: sparse: expected unsigned int [noderef] [usertype] __iomem *gatt_table
drivers/char/agp/uninorth-agp.c:424:28: sparse: got void *
drivers/char/agp/uninorth-agp.c:434:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int static [assigned] [toplevel] [usertype] scratch_value @@ got restricted __le32 [usertype] @@
drivers/char/agp/uninorth-agp.c:434:31: sparse: expected unsigned int static [assigned] [toplevel] [usertype] scratch_value
drivers/char/agp/uninorth-agp.c:434:31: sparse: got restricted __le32 [usertype]
>> drivers/char/agp/uninorth-agp.c:463:22: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const *addr @@ got unsigned int [noderef] [usertype] __iomem *gatt_table @@
drivers/char/agp/uninorth-agp.c:463:22: sparse: expected void const *addr
>> drivers/char/agp/uninorth-agp.c:463:22: sparse: got unsigned int [noderef] [usertype] __iomem *gatt_table
drivers/char/agp/uninorth-agp.c:510:32: sparse: sparse: symbol 'uninorth_agp_driver' was not declared. Should it be static?
drivers/char/agp/uninorth-agp.c:538:32: sparse: sparse: symbol 'u3_agp_driver' was not declared. Should it be static?
drivers/char/agp/uninorth-agp.c:437:35: sparse: sparse: dereference of noderef expression
--
drivers/video/fbdev/platinumfb.h:346:19: sparse: sparse: symbol 'vmode_attrs' was not declared. Should it be static?
>> drivers/video/fbdev/platinumfb.c:588:17: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char volatile [usertype] *fbuffer @@ got unsigned char volatile [noderef] [usertype] __iomem *base_frame_buffer @@
drivers/video/fbdev/platinumfb.c:588:17: sparse: expected unsigned char volatile [usertype] *fbuffer
>> drivers/video/fbdev/platinumfb.c:588:17: sparse: got unsigned char volatile [noderef] [usertype] __iomem *base_frame_buffer
--
>> drivers/video/fbdev/chipsfb.c:334:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *s @@ got char [noderef] __iomem *screen_base @@
drivers/video/fbdev/chipsfb.c:334:9: sparse: expected void *s
>> drivers/video/fbdev/chipsfb.c:334:9: sparse: got char [noderef] __iomem *screen_base

vim +63 drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c

25d295882a1adf drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c Ilia Mirkin 2015-10-01 51
ad4a362635353f drivers/gpu/drm/nouveau/core/subdev/bios/shadowof.c Ben Skeggs 2014-09-18 52 static void *
d390b48027f886 drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c Ben Skeggs 2015-01-14 53 of_init(struct nvkm_bios *bios, const char *name)
ad4a362635353f drivers/gpu/drm/nouveau/core/subdev/bios/shadowof.c Ben Skeggs 2014-09-18 54 {
25d295882a1adf drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c Ilia Mirkin 2015-10-01 55 struct nvkm_device *device = bios->subdev.device;
25d295882a1adf drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c Ilia Mirkin 2015-10-01 56 struct pci_dev *pdev = device->func->pci(device)->pdev;
ad4a362635353f drivers/gpu/drm/nouveau/core/subdev/bios/shadowof.c Ben Skeggs 2014-09-18 57 struct device_node *dn;
ad4a362635353f drivers/gpu/drm/nouveau/core/subdev/bios/shadowof.c Ben Skeggs 2014-09-18 58 struct priv *priv;
ad4a362635353f drivers/gpu/drm/nouveau/core/subdev/bios/shadowof.c Ben Skeggs 2014-09-18 59 if (!(dn = pci_device_to_OF_node(pdev)))
ad4a362635353f drivers/gpu/drm/nouveau/core/subdev/bios/shadowof.c Ben Skeggs 2014-09-18 60 return ERR_PTR(-ENODEV);
ad4a362635353f drivers/gpu/drm/nouveau/core/subdev/bios/shadowof.c Ben Skeggs 2014-09-18 61 if (!(priv = kzalloc(sizeof(*priv), GFP_KERNEL)))
ad4a362635353f drivers/gpu/drm/nouveau/core/subdev/bios/shadowof.c Ben Skeggs 2014-09-18 62 return ERR_PTR(-ENOMEM);
ad4a362635353f drivers/gpu/drm/nouveau/core/subdev/bios/shadowof.c Ben Skeggs 2014-09-18 @63 if ((priv->data = of_get_property(dn, "NVDA,BMP", &priv->size)))
ad4a362635353f drivers/gpu/drm/nouveau/core/subdev/bios/shadowof.c Ben Skeggs 2014-09-18 64 return priv;
ad4a362635353f drivers/gpu/drm/nouveau/core/subdev/bios/shadowof.c Ben Skeggs 2014-09-18 65 kfree(priv);
ad4a362635353f drivers/gpu/drm/nouveau/core/subdev/bios/shadowof.c Ben Skeggs 2014-09-18 66 return ERR_PTR(-EINVAL);
ad4a362635353f drivers/gpu/drm/nouveau/core/subdev/bios/shadowof.c Ben Skeggs 2014-09-18 67 }
ad4a362635353f drivers/gpu/drm/nouveau/core/subdev/bios/shadowof.c Ben Skeggs 2014-09-18 68

:::::: The code at line 63 was first introduced by commit
:::::: ad4a362635353f7ceb66f4038269770fee1025fa drm/nouveau/bios: split out shadow methods

:::::: TO: Ben Skeggs <bskeggs@xxxxxxxxxx>
:::::: CC: Ben Skeggs <bskeggs@xxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip