tree:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 18250b538735142307082e4e99e3ae5c12d44013
commit: ef5a3a4c5d5d2be41ac4786a19172744bb18ecec [12765/13394]
include/linux/compiler-gcc.h: sparse can do constant folding of __builtin_bswap*()
config: x86_64-randconfig-s021-20210419 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-330-g09ec74f6-dirty
#
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
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 ef5a3a4c5d5d2be41ac4786a19172744bb18ecec
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)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:24: sparse: sparse: incorrect type in argument 1
(different base types) @@ expected unsigned int val @@ got restricted __le32
[usertype] @@
drivers/scsi/bfa/bfa_ioc.c:1780:24: sparse: expected unsigned int val
drivers/scsi/bfa/bfa_ioc.c:1780:24: sparse: got restricted __le32 [usertype]
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(a)brocade.com>
:::::: CC: James Bottomley <James.Bottomley(a)suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org