[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202007272001.sFfX5mtz%lkp@intel.com>
Date: Mon, 27 Jul 2020 20:05:08 +0800
From: kernel test robot <lkp@...el.com>
To: Luc Van Oostenryck <luc.vanoostenryck@...il.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: drivers/uio/uio_fsl_elbc_gpcm.c:86:53: sparse: sparse: incorrect
type in initializer (different address spaces)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 92ed301919932f777713b9172e525674157e983d
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 6 weeks ago
config: powerpc64-randconfig-s032-20200727 (attached as .config)
compiler: powerpc-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.2-94-geb6779f6-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# 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=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/uio/uio_fsl_elbc_gpcm.c:86:53: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct fsl_lbc_bank *bank @@ got struct fsl_lbc_bank [noderef] __iomem * @@
drivers/uio/uio_fsl_elbc_gpcm.c:86:53: sparse: expected struct fsl_lbc_bank *bank
>> drivers/uio/uio_fsl_elbc_gpcm.c:86:53: sparse: got struct fsl_lbc_bank [noderef] __iomem *
>> drivers/uio/uio_fsl_elbc_gpcm.c:90:43: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int const volatile [noderef] [usertype] __iomem *addr @@ got restricted __be32 * @@
>> drivers/uio/uio_fsl_elbc_gpcm.c:90:43: sparse: expected unsigned int const volatile [noderef] [usertype] __iomem *addr
drivers/uio/uio_fsl_elbc_gpcm.c:90:43: sparse: got restricted __be32 *
drivers/uio/uio_fsl_elbc_gpcm.c:94:43: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int const volatile [noderef] [usertype] __iomem *addr @@ got restricted __be32 * @@
drivers/uio/uio_fsl_elbc_gpcm.c:94:43: sparse: expected unsigned int const volatile [noderef] [usertype] __iomem *addr
drivers/uio/uio_fsl_elbc_gpcm.c:94:43: sparse: got restricted __be32 *
drivers/uio/uio_fsl_elbc_gpcm.c:105:53: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct fsl_lbc_bank *bank @@ got struct fsl_lbc_bank [noderef] __iomem * @@
drivers/uio/uio_fsl_elbc_gpcm.c:105:53: sparse: expected struct fsl_lbc_bank *bank
drivers/uio/uio_fsl_elbc_gpcm.c:105:53: sparse: got struct fsl_lbc_bank [noderef] __iomem *
drivers/uio/uio_fsl_elbc_gpcm.c:117:31: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int const volatile [noderef] [usertype] __iomem *addr @@ got restricted __be32 * @@
drivers/uio/uio_fsl_elbc_gpcm.c:117:31: sparse: expected unsigned int const volatile [noderef] [usertype] __iomem *addr
drivers/uio/uio_fsl_elbc_gpcm.c:117:31: sparse: got restricted __be32 *
drivers/uio/uio_fsl_elbc_gpcm.c:118:31: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int const volatile [noderef] [usertype] __iomem *addr @@ got restricted __be32 * @@
drivers/uio/uio_fsl_elbc_gpcm.c:118:31: sparse: expected unsigned int const volatile [noderef] [usertype] __iomem *addr
drivers/uio/uio_fsl_elbc_gpcm.c:118:31: sparse: got restricted __be32 *
>> drivers/uio/uio_fsl_elbc_gpcm.c:132:27: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int volatile [noderef] [usertype] __iomem *addr @@ got restricted __be32 * @@
>> drivers/uio/uio_fsl_elbc_gpcm.c:132:27: sparse: expected unsigned int volatile [noderef] [usertype] __iomem *addr
drivers/uio/uio_fsl_elbc_gpcm.c:132:27: sparse: got restricted __be32 *
drivers/uio/uio_fsl_elbc_gpcm.c:140:27: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int volatile [noderef] [usertype] __iomem *addr @@ got restricted __be32 * @@
drivers/uio/uio_fsl_elbc_gpcm.c:140:27: sparse: expected unsigned int volatile [noderef] [usertype] __iomem *addr
drivers/uio/uio_fsl_elbc_gpcm.c:140:27: sparse: got restricted __be32 *
>> drivers/uio/uio_fsl_elbc_gpcm.c:347:46: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int const volatile [noderef] [usertype] __iomem *addr @@ got restricted __be32 [noderef] __iomem * @@
drivers/uio/uio_fsl_elbc_gpcm.c:347:46: sparse: expected unsigned int const volatile [noderef] [usertype] __iomem *addr
>> drivers/uio/uio_fsl_elbc_gpcm.c:347:46: sparse: got restricted __be32 [noderef] __iomem *
drivers/uio/uio_fsl_elbc_gpcm.c:348:46: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int const volatile [noderef] [usertype] __iomem *addr @@ got restricted __be32 [noderef] __iomem * @@
drivers/uio/uio_fsl_elbc_gpcm.c:348:46: sparse: expected unsigned int const volatile [noderef] [usertype] __iomem *addr
drivers/uio/uio_fsl_elbc_gpcm.c:348:46: sparse: got restricted __be32 [noderef] __iomem *
>> drivers/uio/uio_fsl_elbc_gpcm.c:378:34: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int volatile [noderef] [usertype] __iomem *addr @@ got restricted __be32 [noderef] __iomem * @@
drivers/uio/uio_fsl_elbc_gpcm.c:378:34: sparse: expected unsigned int volatile [noderef] [usertype] __iomem *addr
drivers/uio/uio_fsl_elbc_gpcm.c:378:34: sparse: got restricted __be32 [noderef] __iomem *
drivers/uio/uio_fsl_elbc_gpcm.c:379:34: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int volatile [noderef] [usertype] __iomem *addr @@ got restricted __be32 [noderef] __iomem * @@
drivers/uio/uio_fsl_elbc_gpcm.c:379:34: sparse: expected unsigned int volatile [noderef] [usertype] __iomem *addr
drivers/uio/uio_fsl_elbc_gpcm.c:379:34: sparse: got restricted __be32 [noderef] __iomem *
--
>> arch/powerpc/platforms/powermac/nvram.c:304:24: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const *s @@ got unsigned char [noderef] [usertype] __iomem *base @@
arch/powerpc/platforms/powermac/nvram.c:304:24: sparse: expected void const *s
>> arch/powerpc/platforms/powermac/nvram.c:304:24: sparse: got unsigned char [noderef] [usertype] __iomem *base
>> arch/powerpc/platforms/powermac/nvram.c:338:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got unsigned char [noderef] [usertype] __iomem *base @@
arch/powerpc/platforms/powermac/nvram.c:338:20: sparse: expected void const *
arch/powerpc/platforms/powermac/nvram.c:338:20: sparse: got unsigned char [noderef] [usertype] __iomem *base
arch/powerpc/platforms/powermac/nvram.c:384:24: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const *s @@ got unsigned char [noderef] [usertype] __iomem *base @@
arch/powerpc/platforms/powermac/nvram.c:384:24: sparse: expected void const *s
arch/powerpc/platforms/powermac/nvram.c:384:24: sparse: got unsigned char [noderef] [usertype] __iomem *base
arch/powerpc/platforms/powermac/nvram.c:429:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got unsigned char [noderef] [usertype] __iomem *base @@
arch/powerpc/platforms/powermac/nvram.c:429:20: sparse: expected void const *
arch/powerpc/platforms/powermac/nvram.c:429:20: sparse: got unsigned char [noderef] [usertype] __iomem *base
>> arch/powerpc/platforms/powermac/nvram.c:480:35: sparse: sparse: cast removes address space '__iomem' of expression
arch/powerpc/platforms/powermac/nvram.c:526:35: sparse: sparse: cast removes address space '__iomem' of expression
arch/powerpc/platforms/powermac/nvram.c:527:35: sparse: sparse: cast removes address space '__iomem' of expression
arch/powerpc/platforms/powermac/nvram.c:534:44: sparse: sparse: dereference of noderef expression
vim +86 drivers/uio/uio_fsl_elbc_gpcm.c
0682e005d1705a Greg Kroah-Hartman 2019-07-31 80
fbc4a8a85777e0 John Ogness 2014-12-09 81 static ssize_t reg_show(struct device *dev, struct device_attribute *attr,
fbc4a8a85777e0 John Ogness 2014-12-09 82 char *buf)
fbc4a8a85777e0 John Ogness 2014-12-09 83 {
24438e46268c72 Wolfram Sang 2018-10-21 84 struct uio_info *info = dev_get_drvdata(dev);
fbc4a8a85777e0 John Ogness 2014-12-09 85 struct fsl_elbc_gpcm *priv = info->priv;
fbc4a8a85777e0 John Ogness 2014-12-09 @86 struct fsl_lbc_bank *bank = &priv->lbc->bank[priv->bank];
fbc4a8a85777e0 John Ogness 2014-12-09 87
fbc4a8a85777e0 John Ogness 2014-12-09 88 if (attr == &dev_attr_reg_br) {
fbc4a8a85777e0 John Ogness 2014-12-09 89 return scnprintf(buf, PAGE_SIZE, "0x%08x\n",
fbc4a8a85777e0 John Ogness 2014-12-09 @90 in_be32(&bank->br));
fbc4a8a85777e0 John Ogness 2014-12-09 91
fbc4a8a85777e0 John Ogness 2014-12-09 92 } else if (attr == &dev_attr_reg_or) {
fbc4a8a85777e0 John Ogness 2014-12-09 93 return scnprintf(buf, PAGE_SIZE, "0x%08x\n",
fbc4a8a85777e0 John Ogness 2014-12-09 94 in_be32(&bank->or));
fbc4a8a85777e0 John Ogness 2014-12-09 95 }
fbc4a8a85777e0 John Ogness 2014-12-09 96
fbc4a8a85777e0 John Ogness 2014-12-09 97 return 0;
fbc4a8a85777e0 John Ogness 2014-12-09 98 }
fbc4a8a85777e0 John Ogness 2014-12-09 99
fbc4a8a85777e0 John Ogness 2014-12-09 100 static ssize_t reg_store(struct device *dev, struct device_attribute *attr,
fbc4a8a85777e0 John Ogness 2014-12-09 101 const char *buf, size_t count)
fbc4a8a85777e0 John Ogness 2014-12-09 102 {
24438e46268c72 Wolfram Sang 2018-10-21 103 struct uio_info *info = dev_get_drvdata(dev);
fbc4a8a85777e0 John Ogness 2014-12-09 104 struct fsl_elbc_gpcm *priv = info->priv;
fbc4a8a85777e0 John Ogness 2014-12-09 @105 struct fsl_lbc_bank *bank = &priv->lbc->bank[priv->bank];
fbc4a8a85777e0 John Ogness 2014-12-09 106 unsigned long val;
fbc4a8a85777e0 John Ogness 2014-12-09 107 u32 reg_br_cur;
fbc4a8a85777e0 John Ogness 2014-12-09 108 u32 reg_or_cur;
fbc4a8a85777e0 John Ogness 2014-12-09 109 u32 reg_new;
fbc4a8a85777e0 John Ogness 2014-12-09 110
fbc4a8a85777e0 John Ogness 2014-12-09 111 /* parse use input */
fbc4a8a85777e0 John Ogness 2014-12-09 112 if (kstrtoul(buf, 0, &val) != 0)
fbc4a8a85777e0 John Ogness 2014-12-09 113 return -EINVAL;
fbc4a8a85777e0 John Ogness 2014-12-09 114 reg_new = (u32)val;
fbc4a8a85777e0 John Ogness 2014-12-09 115
fbc4a8a85777e0 John Ogness 2014-12-09 116 /* read current values */
fbc4a8a85777e0 John Ogness 2014-12-09 117 reg_br_cur = in_be32(&bank->br);
fbc4a8a85777e0 John Ogness 2014-12-09 @118 reg_or_cur = in_be32(&bank->or);
fbc4a8a85777e0 John Ogness 2014-12-09 119
fbc4a8a85777e0 John Ogness 2014-12-09 120 if (attr == &dev_attr_reg_br) {
fbc4a8a85777e0 John Ogness 2014-12-09 121 /* not allowed to change effective base address */
fbc4a8a85777e0 John Ogness 2014-12-09 122 if ((reg_br_cur & reg_or_cur & BR_BA) !=
fbc4a8a85777e0 John Ogness 2014-12-09 123 (reg_new & reg_or_cur & BR_BA)) {
fbc4a8a85777e0 John Ogness 2014-12-09 124 return -EINVAL;
fbc4a8a85777e0 John Ogness 2014-12-09 125 }
fbc4a8a85777e0 John Ogness 2014-12-09 126
fbc4a8a85777e0 John Ogness 2014-12-09 127 /* not allowed to change mode */
fbc4a8a85777e0 John Ogness 2014-12-09 128 if ((reg_new & BR_MSEL) != BR_MS_GPCM)
fbc4a8a85777e0 John Ogness 2014-12-09 129 return -EINVAL;
fbc4a8a85777e0 John Ogness 2014-12-09 130
fbc4a8a85777e0 John Ogness 2014-12-09 131 /* write new value (force valid) */
fbc4a8a85777e0 John Ogness 2014-12-09 @132 out_be32(&bank->br, reg_new | BR_V);
fbc4a8a85777e0 John Ogness 2014-12-09 133
fbc4a8a85777e0 John Ogness 2014-12-09 134 } else if (attr == &dev_attr_reg_or) {
fbc4a8a85777e0 John Ogness 2014-12-09 135 /* not allowed to change access mask */
fbc4a8a85777e0 John Ogness 2014-12-09 136 if ((reg_or_cur & OR_GPCM_AM) != (reg_new & OR_GPCM_AM))
fbc4a8a85777e0 John Ogness 2014-12-09 137 return -EINVAL;
fbc4a8a85777e0 John Ogness 2014-12-09 138
fbc4a8a85777e0 John Ogness 2014-12-09 139 /* write new value */
fbc4a8a85777e0 John Ogness 2014-12-09 @140 out_be32(&bank->or, reg_new);
fbc4a8a85777e0 John Ogness 2014-12-09 141
fbc4a8a85777e0 John Ogness 2014-12-09 142 } else {
fbc4a8a85777e0 John Ogness 2014-12-09 143 return -EINVAL;
fbc4a8a85777e0 John Ogness 2014-12-09 144 }
fbc4a8a85777e0 John Ogness 2014-12-09 145
fbc4a8a85777e0 John Ogness 2014-12-09 146 return count;
fbc4a8a85777e0 John Ogness 2014-12-09 147 }
fbc4a8a85777e0 John Ogness 2014-12-09 148
:::::: The code at line 86 was first introduced by commit
:::::: fbc4a8a85777e065f7a195ddc58b3245808f1e87 uio: uio_fsl_elbc_gpcm: new driver
:::::: TO: John Ogness <john.ogness@...utronix.de>
:::::: CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (31655 bytes)
Powered by blists - more mailing lists