From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [linux-next:master 2366/3917] drivers/scsi/bfa/bfa_ioc.c:2066:21: sparse: sparse: incorrect type in assignment (different base types)
Date: Fri, 12 Mar 2021 05:52:14 +0800 [thread overview]
Message-ID: <202103120506.F6TMAeFE-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 18628 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 98546348153dee5f8ced572fd6c4690461d20f51
commit: 960984d964a9341cf50bf2b4ffdf0beb14467517 [2366/3917] include/linux/compiler-gcc.h: sparse can do constant folding of __builtin_bswap*()
config: arm-randconfig-s032-20210311 (attached as .config)
compiler: arm-linux-gnueabi-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.3-262-g5e674421-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=960984d964a9341cf50bf2b4ffdf0beb14467517
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 960984d964a9341cf50bf2b4ffdf0beb14467517
# 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=arm
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/scsi/bfa/bfa_ioc.c:1800:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [assigned] [usertype] clscode @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:1800:28: sparse: expected unsigned short [assigned] [usertype] clscode
drivers/scsi/bfa/bfa_ioc.c:1800:28: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:1802:29: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:1813:29: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [assigned] [usertype] clscode @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:1813:29: sparse: expected unsigned short [assigned] [usertype] clscode
drivers/scsi/bfa/bfa_ioc.c:1813:29: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:1815:30: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:1780:17: sparse: sparse: cast from restricted __le32
drivers/scsi/bfa/bfa_ioc.c:1963:31: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:1964:31: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:1965:31: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:1967:27: sparse: sparse: cast to restricted __be16
>> drivers/scsi/bfa/bfa_ioc.c:2066:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 [usertype] r32 @@ got unsigned int [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:2066:21: sparse: expected restricted __be32 [usertype] r32
drivers/scsi/bfa/bfa_ioc.c:2066:21: sparse: got unsigned int [usertype]
drivers/scsi/bfa/bfa_ioc.c:2067:26: sparse: sparse: cast from restricted __be32
drivers/scsi/bfa/bfa_ioc.c:2989:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] clscode @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:2989:22: sparse: expected unsigned short [usertype] clscode
drivers/scsi/bfa/bfa_ioc.c:2989:22: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:3265:52: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:3267:58: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:3269:59: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:3271:54: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:3273:54: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:3440:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] pers @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:3440:17: sparse: expected unsigned short [usertype] pers
drivers/scsi/bfa/bfa_ioc.c:3440:17: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:3441:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] bw_min @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:3441:19: sparse: expected unsigned short [usertype] bw_min
drivers/scsi/bfa/bfa_ioc.c:3441:19: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:3442:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] bw_max @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:3442:19: sparse: expected unsigned short [usertype] bw_max
drivers/scsi/bfa/bfa_ioc.c:3442:19: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:3565:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] bw_min @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:3565:19: sparse: expected unsigned short [usertype] bw_min
drivers/scsi/bfa/bfa_ioc.c:3565:19: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:3566:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] bw_max @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:3566:19: sparse: expected unsigned short [usertype] bw_max
drivers/scsi/bfa/bfa_ioc.c:3566:19: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:4268:21: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4270:23: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4273:23: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4301:21: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4303:23: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4306:23: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4325:21: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4364:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4372:40: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4373:39: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4378:41: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4380:41: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4382:41: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4384:41: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4386:41: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4388:41: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4395:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4401:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4412:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4418:35: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4435:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4441:33: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4829:27: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] count @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:4829:27: sparse: expected unsigned int [usertype] count
drivers/scsi/bfa/bfa_ioc.c:4829:27: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:4924:36: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:4933:33: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:4979:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] freq @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:4979:19: sparse: expected unsigned short [usertype] freq
drivers/scsi/bfa/bfa_ioc.c:4979:19: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:5006:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] period @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:5006:21: sparse: expected unsigned int [usertype] period
drivers/scsi/bfa/bfa_ioc.c:5006:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:5301:27: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:5367:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] offset @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:5367:21: sparse: expected unsigned int [usertype] offset
drivers/scsi/bfa/bfa_ioc.c:5367:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:5370:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:5370:21: sparse: expected unsigned int [usertype] length
drivers/scsi/bfa/bfa_ioc.c:5370:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:5383:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:5383:24: sparse: expected unsigned short [usertype]
drivers/scsi/bfa/bfa_ioc.c:5383:24: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:5405:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] offset @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:5405:21: sparse: expected unsigned int [usertype] offset
drivers/scsi/bfa/bfa_ioc.c:5405:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:5408:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:5408:21: sparse: expected unsigned int [usertype] length
drivers/scsi/bfa/bfa_ioc.c:5408:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:5722:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:5740:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:5757:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:5771:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:5780:35: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:5789:42: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:6222:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] offset @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:6222:21: sparse: expected unsigned int [usertype] offset
drivers/scsi/bfa/bfa_ioc.c:6222:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:6225:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:6225:21: sparse: expected unsigned int [usertype] length
drivers/scsi/bfa/bfa_ioc.c:6225:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:6256:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] offset @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:6256:21: sparse: expected unsigned int [usertype] offset
drivers/scsi/bfa/bfa_ioc.c:6256:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:6259:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:6259:21: sparse: expected unsigned int [usertype] length
drivers/scsi/bfa/bfa_ioc.c:6259:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:6571:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:6591:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:6600:35: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c: note: in included file (through drivers/scsi/bfa/bfa.h, drivers/scsi/bfa/bfa_modules.h, drivers/scsi/bfa/bfad_drv.h):
drivers/scsi/bfa/bfa_ioc.h:190:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] al_len @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.h:190:22: sparse: expected unsigned int [usertype] al_len
drivers/scsi/bfa/bfa_ioc.h:190:22: sparse: got restricted __be32 [usertype]
vim +2066 drivers/scsi/bfa/bfa_ioc.c
a36c61f9025b89 Krishna Gudipati 2010-09-15 2030
5fbe25c7a66460 Jing Huang 2010-10-18 2031 /*
a36c61f9025b89 Krishna Gudipati 2010-09-15 2032 * Read data from SMEM to host through PCI memmap
a36c61f9025b89 Krishna Gudipati 2010-09-15 2033 *
a36c61f9025b89 Krishna Gudipati 2010-09-15 2034 * @param[in] ioc memory for IOC
a36c61f9025b89 Krishna Gudipati 2010-09-15 2035 * @param[in] tbuf app memory to store data from smem
a36c61f9025b89 Krishna Gudipati 2010-09-15 2036 * @param[in] soff smem offset
a36c61f9025b89 Krishna Gudipati 2010-09-15 2037 * @param[in] sz size of smem in bytes
a36c61f9025b89 Krishna Gudipati 2010-09-15 2038 */
a36c61f9025b89 Krishna Gudipati 2010-09-15 2039 static bfa_status_t
a36c61f9025b89 Krishna Gudipati 2010-09-15 2040 bfa_ioc_smem_read(struct bfa_ioc_s *ioc, void *tbuf, u32 soff, u32 sz)
a36c61f9025b89 Krishna Gudipati 2010-09-15 2041 {
50444a34002811 Maggie 2010-11-29 2042 u32 pgnum, loff;
50444a34002811 Maggie 2010-11-29 2043 __be32 r32;
a36c61f9025b89 Krishna Gudipati 2010-09-15 2044 int i, len;
a36c61f9025b89 Krishna Gudipati 2010-09-15 2045 u32 *buf = tbuf;
a36c61f9025b89 Krishna Gudipati 2010-09-15 2046
f7f73812e95077 Maggie Zhang 2010-12-09 2047 pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, soff);
f7f73812e95077 Maggie Zhang 2010-12-09 2048 loff = PSS_SMEM_PGOFF(soff);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2049 bfa_trc(ioc, pgnum);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2050 bfa_trc(ioc, loff);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2051 bfa_trc(ioc, sz);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2052
a36c61f9025b89 Krishna Gudipati 2010-09-15 2053 /*
a36c61f9025b89 Krishna Gudipati 2010-09-15 2054 * Hold semaphore to serialize pll init and fwtrc.
a36c61f9025b89 Krishna Gudipati 2010-09-15 2055 */
a36c61f9025b89 Krishna Gudipati 2010-09-15 2056 if (BFA_FALSE == bfa_ioc_sem_get(ioc->ioc_regs.ioc_init_sem_reg)) {
a36c61f9025b89 Krishna Gudipati 2010-09-15 2057 bfa_trc(ioc, 0);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2058 return BFA_STATUS_FAILED;
a36c61f9025b89 Krishna Gudipati 2010-09-15 2059 }
a36c61f9025b89 Krishna Gudipati 2010-09-15 2060
5344026065f79b Jing Huang 2010-10-18 2061 writel(pgnum, ioc->ioc_regs.host_page_num_fn);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2062
a36c61f9025b89 Krishna Gudipati 2010-09-15 2063 len = sz/sizeof(u32);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2064 bfa_trc(ioc, len);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2065 for (i = 0; i < len; i++) {
a36c61f9025b89 Krishna Gudipati 2010-09-15 @2066 r32 = bfa_mem_read(ioc->ioc_regs.smem_page_start, loff);
ba1340788ff302 Vijaya Mohan Guvva 2013-05-13 2067 buf[i] = swab32(r32);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2068 loff += sizeof(u32);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2069
5fbe25c7a66460 Jing Huang 2010-10-18 2070 /*
a36c61f9025b89 Krishna Gudipati 2010-09-15 2071 * handle page offset wrap around
a36c61f9025b89 Krishna Gudipati 2010-09-15 2072 */
a36c61f9025b89 Krishna Gudipati 2010-09-15 2073 loff = PSS_SMEM_PGOFF(loff);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2074 if (loff == 0) {
a36c61f9025b89 Krishna Gudipati 2010-09-15 2075 pgnum++;
5344026065f79b Jing Huang 2010-10-18 2076 writel(pgnum, ioc->ioc_regs.host_page_num_fn);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2077 }
a36c61f9025b89 Krishna Gudipati 2010-09-15 2078 }
f7f73812e95077 Maggie Zhang 2010-12-09 2079 writel(PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, 0),
f7f73812e95077 Maggie Zhang 2010-12-09 2080 ioc->ioc_regs.host_page_num_fn);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2081 /*
a36c61f9025b89 Krishna Gudipati 2010-09-15 2082 * release semaphore.
a36c61f9025b89 Krishna Gudipati 2010-09-15 2083 */
5a0adaedffce91 Krishna Gudipati 2011-06-24 2084 readl(ioc->ioc_regs.ioc_init_sem_reg);
f7f73812e95077 Maggie Zhang 2010-12-09 2085 writel(1, ioc->ioc_regs.ioc_init_sem_reg);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2086
a36c61f9025b89 Krishna Gudipati 2010-09-15 2087 bfa_trc(ioc, pgnum);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2088 return BFA_STATUS_OK;
a36c61f9025b89 Krishna Gudipati 2010-09-15 2089 }
a36c61f9025b89 Krishna Gudipati 2010-09-15 2090
:::::: The code at line 2066 was first introduced by commit
:::::: a36c61f9025b8924f99f54d518763bee7aa84085 [SCSI] bfa: cleanup driver
:::::: TO: Krishna Gudipati <kgudipat@brocade.com>
:::::: CC: James Bottomley <James.Bottomley@suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 54079 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [linux-next:master 2366/3917] drivers/scsi/bfa/bfa_ioc.c:2066:21: sparse: sparse: incorrect type in assignment (different base types)
Date: Fri, 12 Mar 2021 05:52:14 +0800 [thread overview]
Message-ID: <202103120506.F6TMAeFE-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 18416 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 98546348153dee5f8ced572fd6c4690461d20f51
commit: 960984d964a9341cf50bf2b4ffdf0beb14467517 [2366/3917] include/linux/compiler-gcc.h: sparse can do constant folding of __builtin_bswap*()
config: arm-randconfig-s032-20210311 (attached as .config)
compiler: arm-linux-gnueabi-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.3-262-g5e674421-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=960984d964a9341cf50bf2b4ffdf0beb14467517
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 960984d964a9341cf50bf2b4ffdf0beb14467517
# 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=arm
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/scsi/bfa/bfa_ioc.c:1800:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [assigned] [usertype] clscode @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:1800:28: sparse: expected unsigned short [assigned] [usertype] clscode
drivers/scsi/bfa/bfa_ioc.c:1800:28: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:1802:29: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:1813:29: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [assigned] [usertype] clscode @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:1813:29: sparse: expected unsigned short [assigned] [usertype] clscode
drivers/scsi/bfa/bfa_ioc.c:1813:29: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:1815:30: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:1780:17: sparse: sparse: cast from restricted __le32
drivers/scsi/bfa/bfa_ioc.c:1963:31: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:1964:31: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:1965:31: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:1967:27: sparse: sparse: cast to restricted __be16
>> drivers/scsi/bfa/bfa_ioc.c:2066:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 [usertype] r32 @@ got unsigned int [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:2066:21: sparse: expected restricted __be32 [usertype] r32
drivers/scsi/bfa/bfa_ioc.c:2066:21: sparse: got unsigned int [usertype]
drivers/scsi/bfa/bfa_ioc.c:2067:26: sparse: sparse: cast from restricted __be32
drivers/scsi/bfa/bfa_ioc.c:2989:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] clscode @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:2989:22: sparse: expected unsigned short [usertype] clscode
drivers/scsi/bfa/bfa_ioc.c:2989:22: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:3265:52: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:3267:58: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:3269:59: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:3271:54: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:3273:54: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:3440:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] pers @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:3440:17: sparse: expected unsigned short [usertype] pers
drivers/scsi/bfa/bfa_ioc.c:3440:17: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:3441:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] bw_min @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:3441:19: sparse: expected unsigned short [usertype] bw_min
drivers/scsi/bfa/bfa_ioc.c:3441:19: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:3442:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] bw_max @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:3442:19: sparse: expected unsigned short [usertype] bw_max
drivers/scsi/bfa/bfa_ioc.c:3442:19: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:3565:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] bw_min @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:3565:19: sparse: expected unsigned short [usertype] bw_min
drivers/scsi/bfa/bfa_ioc.c:3565:19: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:3566:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] bw_max @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:3566:19: sparse: expected unsigned short [usertype] bw_max
drivers/scsi/bfa/bfa_ioc.c:3566:19: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:4268:21: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4270:23: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4273:23: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4301:21: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4303:23: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4306:23: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4325:21: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4364:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4372:40: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4373:39: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4378:41: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4380:41: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4382:41: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4384:41: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4386:41: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4388:41: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4395:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4401:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4412:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4418:35: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4435:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4441:33: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:4829:27: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] count @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:4829:27: sparse: expected unsigned int [usertype] count
drivers/scsi/bfa/bfa_ioc.c:4829:27: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:4924:36: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:4933:33: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:4979:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] freq @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:4979:19: sparse: expected unsigned short [usertype] freq
drivers/scsi/bfa/bfa_ioc.c:4979:19: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:5006:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] period @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:5006:21: sparse: expected unsigned int [usertype] period
drivers/scsi/bfa/bfa_ioc.c:5006:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:5301:27: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:5367:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] offset @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:5367:21: sparse: expected unsigned int [usertype] offset
drivers/scsi/bfa/bfa_ioc.c:5367:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:5370:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:5370:21: sparse: expected unsigned int [usertype] length
drivers/scsi/bfa/bfa_ioc.c:5370:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:5383:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] @@ got restricted __be16 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:5383:24: sparse: expected unsigned short [usertype]
drivers/scsi/bfa/bfa_ioc.c:5383:24: sparse: got restricted __be16 [usertype]
drivers/scsi/bfa/bfa_ioc.c:5405:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] offset @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:5405:21: sparse: expected unsigned int [usertype] offset
drivers/scsi/bfa/bfa_ioc.c:5405:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:5408:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:5408:21: sparse: expected unsigned int [usertype] length
drivers/scsi/bfa/bfa_ioc.c:5408:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:5722:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:5740:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:5757:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:5771:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:5780:35: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:5789:42: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfa_ioc.c:6222:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] offset @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:6222:21: sparse: expected unsigned int [usertype] offset
drivers/scsi/bfa/bfa_ioc.c:6222:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:6225:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:6225:21: sparse: expected unsigned int [usertype] length
drivers/scsi/bfa/bfa_ioc.c:6225:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:6256:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] offset @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:6256:21: sparse: expected unsigned int [usertype] offset
drivers/scsi/bfa/bfa_ioc.c:6256:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:6259:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.c:6259:21: sparse: expected unsigned int [usertype] length
drivers/scsi/bfa/bfa_ioc.c:6259:21: sparse: got restricted __be32 [usertype]
drivers/scsi/bfa/bfa_ioc.c:6571:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:6591:26: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c:6600:35: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfa_ioc.c: note: in included file (through drivers/scsi/bfa/bfa.h, drivers/scsi/bfa/bfa_modules.h, drivers/scsi/bfa/bfad_drv.h):
drivers/scsi/bfa/bfa_ioc.h:190:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] al_len @@ got restricted __be32 [usertype] @@
drivers/scsi/bfa/bfa_ioc.h:190:22: sparse: expected unsigned int [usertype] al_len
drivers/scsi/bfa/bfa_ioc.h:190:22: sparse: got restricted __be32 [usertype]
vim +2066 drivers/scsi/bfa/bfa_ioc.c
a36c61f9025b89 Krishna Gudipati 2010-09-15 2030
5fbe25c7a66460 Jing Huang 2010-10-18 2031 /*
a36c61f9025b89 Krishna Gudipati 2010-09-15 2032 * Read data from SMEM to host through PCI memmap
a36c61f9025b89 Krishna Gudipati 2010-09-15 2033 *
a36c61f9025b89 Krishna Gudipati 2010-09-15 2034 * @param[in] ioc memory for IOC
a36c61f9025b89 Krishna Gudipati 2010-09-15 2035 * @param[in] tbuf app memory to store data from smem
a36c61f9025b89 Krishna Gudipati 2010-09-15 2036 * @param[in] soff smem offset
a36c61f9025b89 Krishna Gudipati 2010-09-15 2037 * @param[in] sz size of smem in bytes
a36c61f9025b89 Krishna Gudipati 2010-09-15 2038 */
a36c61f9025b89 Krishna Gudipati 2010-09-15 2039 static bfa_status_t
a36c61f9025b89 Krishna Gudipati 2010-09-15 2040 bfa_ioc_smem_read(struct bfa_ioc_s *ioc, void *tbuf, u32 soff, u32 sz)
a36c61f9025b89 Krishna Gudipati 2010-09-15 2041 {
50444a34002811 Maggie 2010-11-29 2042 u32 pgnum, loff;
50444a34002811 Maggie 2010-11-29 2043 __be32 r32;
a36c61f9025b89 Krishna Gudipati 2010-09-15 2044 int i, len;
a36c61f9025b89 Krishna Gudipati 2010-09-15 2045 u32 *buf = tbuf;
a36c61f9025b89 Krishna Gudipati 2010-09-15 2046
f7f73812e95077 Maggie Zhang 2010-12-09 2047 pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, soff);
f7f73812e95077 Maggie Zhang 2010-12-09 2048 loff = PSS_SMEM_PGOFF(soff);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2049 bfa_trc(ioc, pgnum);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2050 bfa_trc(ioc, loff);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2051 bfa_trc(ioc, sz);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2052
a36c61f9025b89 Krishna Gudipati 2010-09-15 2053 /*
a36c61f9025b89 Krishna Gudipati 2010-09-15 2054 * Hold semaphore to serialize pll init and fwtrc.
a36c61f9025b89 Krishna Gudipati 2010-09-15 2055 */
a36c61f9025b89 Krishna Gudipati 2010-09-15 2056 if (BFA_FALSE == bfa_ioc_sem_get(ioc->ioc_regs.ioc_init_sem_reg)) {
a36c61f9025b89 Krishna Gudipati 2010-09-15 2057 bfa_trc(ioc, 0);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2058 return BFA_STATUS_FAILED;
a36c61f9025b89 Krishna Gudipati 2010-09-15 2059 }
a36c61f9025b89 Krishna Gudipati 2010-09-15 2060
5344026065f79b Jing Huang 2010-10-18 2061 writel(pgnum, ioc->ioc_regs.host_page_num_fn);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2062
a36c61f9025b89 Krishna Gudipati 2010-09-15 2063 len = sz/sizeof(u32);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2064 bfa_trc(ioc, len);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2065 for (i = 0; i < len; i++) {
a36c61f9025b89 Krishna Gudipati 2010-09-15 @2066 r32 = bfa_mem_read(ioc->ioc_regs.smem_page_start, loff);
ba1340788ff302 Vijaya Mohan Guvva 2013-05-13 2067 buf[i] = swab32(r32);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2068 loff += sizeof(u32);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2069
5fbe25c7a66460 Jing Huang 2010-10-18 2070 /*
a36c61f9025b89 Krishna Gudipati 2010-09-15 2071 * handle page offset wrap around
a36c61f9025b89 Krishna Gudipati 2010-09-15 2072 */
a36c61f9025b89 Krishna Gudipati 2010-09-15 2073 loff = PSS_SMEM_PGOFF(loff);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2074 if (loff == 0) {
a36c61f9025b89 Krishna Gudipati 2010-09-15 2075 pgnum++;
5344026065f79b Jing Huang 2010-10-18 2076 writel(pgnum, ioc->ioc_regs.host_page_num_fn);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2077 }
a36c61f9025b89 Krishna Gudipati 2010-09-15 2078 }
f7f73812e95077 Maggie Zhang 2010-12-09 2079 writel(PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, 0),
f7f73812e95077 Maggie Zhang 2010-12-09 2080 ioc->ioc_regs.host_page_num_fn);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2081 /*
a36c61f9025b89 Krishna Gudipati 2010-09-15 2082 * release semaphore.
a36c61f9025b89 Krishna Gudipati 2010-09-15 2083 */
5a0adaedffce91 Krishna Gudipati 2011-06-24 2084 readl(ioc->ioc_regs.ioc_init_sem_reg);
f7f73812e95077 Maggie Zhang 2010-12-09 2085 writel(1, ioc->ioc_regs.ioc_init_sem_reg);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2086
a36c61f9025b89 Krishna Gudipati 2010-09-15 2087 bfa_trc(ioc, pgnum);
a36c61f9025b89 Krishna Gudipati 2010-09-15 2088 return BFA_STATUS_OK;
a36c61f9025b89 Krishna Gudipati 2010-09-15 2089 }
a36c61f9025b89 Krishna Gudipati 2010-09-15 2090
:::::: The code at line 2066 was first introduced by commit
:::::: a36c61f9025b8924f99f54d518763bee7aa84085 [SCSI] bfa: cleanup driver
:::::: TO: Krishna Gudipati <kgudipat@brocade.com>
:::::: CC: James Bottomley <James.Bottomley@suse.de>
---
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: 54079 bytes --]
next reply other threads:[~2021-03-11 21:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-11 21:52 kernel test robot [this message]
2021-03-11 21:52 ` [linux-next:master 2366/3917] drivers/scsi/bfa/bfa_ioc.c:2066:21: sparse: sparse: incorrect type in assignment (different base types) kernel test robot
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=202103120506.F6TMAeFE-lkp@intel.com \
--to=lkp@intel.com \
--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.