drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:2135:41: sparse: sparse: incorrect type in argument 1 (different address spaces)

From: kernel test robot
Date: Wed Aug 12 2020 - 22:43:03 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dc06fe51d26efc100ac74121607c01a454867c91
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 8 weeks ago
config: i386-randconfig-s001-20200813 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-168-g9554805c-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386

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/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:2135:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:2135:41: sparse: expected void *reg
>> drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:2135:41: sparse: got unsigned int [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:33: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected unsigned short [usertype] uid_hi @@ got restricted __be16 [usertype] @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:33: sparse: expected unsigned short [usertype] uid_hi
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:33: sparse: got restricted __be16 [usertype]
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:45: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected unsigned int [usertype] uid_lo @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:45: sparse: expected unsigned int [usertype] uid_lo
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:45: sparse: got restricted __be32 [usertype]
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:56: sparse: sparse: incorrect type in argument 4 (different base types) @@ expected unsigned short [usertype] seqid @@ got restricted __be16 [usertype] @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:56: sparse: expected unsigned short [usertype] seqid
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:56: sparse: got restricted __be16 [usertype]
>> drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:306:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __iomem * @@ got void *reg @@
>> drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:306:26: sparse: expected void [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:306:26: sparse: got void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:336:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:336:33: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:336:33: sparse: got unsigned int [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:343:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:343:33: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:343:33: sparse: got unsigned int [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:356:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:356:33: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:356:33: sparse: got unsigned int [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:397:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:397:33: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:397:33: sparse: got unsigned int [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:466:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:466:41: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:466:41: sparse: got unsigned int [noderef] __iomem *

vim +2135 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c

77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2084
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2085 /**
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2086 * pch_gbe_set_multi - Multicast and Promiscuous mode set
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2087 * @netdev: Network interface device structure
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2088 */
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2089 static void pch_gbe_set_multi(struct net_device *netdev)
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2090 {
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2091 struct pch_gbe_adapter *adapter = netdev_priv(netdev);
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2092 struct pch_gbe_hw *hw = &adapter->hw;
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2093 struct netdev_hw_addr *ha;
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2094 u32 rctl, adrmask;
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2095 int mc_count, i;
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2096
453ca931f51516 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Andy Shevchenko 2013-06-28 2097 netdev_dbg(netdev, "netdev->flags : 0x%08x\n", netdev->flags);
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2098
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2099 /* By default enable address & multicast filtering */
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2100 rctl = ioread32(&hw->reg->RX_MODE);
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2101 rctl |= PCH_GBE_ADD_FIL_EN | PCH_GBE_MLT_FIL_EN;
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2102
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2103 /* Promiscuous mode disables all hardware address filtering */
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2104 if (netdev->flags & IFF_PROMISC)
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2105 rctl &= ~(PCH_GBE_ADD_FIL_EN | PCH_GBE_MLT_FIL_EN);
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2106
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2107 /* If we want to monitor more multicast addresses than the hardware can
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2108 * support then disable hardware multicast filtering.
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2109 */
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2110 mc_count = netdev_mc_count(netdev);
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2111 if ((netdev->flags & IFF_ALLMULTI) || mc_count >= PCH_GBE_MAR_ENTRIES)
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2112 rctl &= ~PCH_GBE_MLT_FIL_EN;
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2113
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2114 iowrite32(rctl, &hw->reg->RX_MODE);
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2115
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2116 /* If we're not using multicast filtering then there's no point
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2117 * configuring the unused MAC address registers.
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2118 */
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2119 if (!(rctl & PCH_GBE_MLT_FIL_EN))
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2120 return;
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2121
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2122 /* Load the first set of multicast addresses into MAC address registers
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2123 * for use by hardware filtering.
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2124 */
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2125 i = 1;
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2126 netdev_for_each_mc_addr(ha, netdev)
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2127 pch_gbe_mac_mar_set(hw, ha->addr, i++);
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2128
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2129 /* If there are spare MAC registers, mask & clear them */
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2130 for (; i < PCH_GBE_MAR_ENTRIES; i++) {
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2131 /* Clear MAC address mask */
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2132 adrmask = ioread32(&hw->reg->ADDR_MASK);
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2133 iowrite32(adrmask | BIT(i), &hw->reg->ADDR_MASK);
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2134 /* wait busy */
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 @2135 pch_gbe_wait_clr_bit(&hw->reg->ADDR_MASK, PCH_GBE_BUSY);
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2136 /* Clear MAC address */
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2137 iowrite32(0, &hw->reg->mac_adr[i].high);
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2138 iowrite32(0, &hw->reg->mac_adr[i].low);
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2139 }
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2140
453ca931f51516 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Andy Shevchenko 2013-06-28 2141 netdev_dbg(netdev,
453ca931f51516 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Andy Shevchenko 2013-06-28 2142 "RX_MODE reg(check bit31,30 ADD,MLT) : 0x%08x netdev->mc_count : 0x%08x\n",
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2143 ioread32(&hw->reg->RX_MODE), mc_count);
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2144 }
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2145

:::::: The code at line 2135 was first introduced by commit
:::::: 6ab91e47694e03775bbe874fa8f15f84db404c00 net: pch_gbe: Inline pch_gbe_mac_mc_addr_list_update

:::::: TO: Paul Burton <paul.burton@xxxxxxxx>
:::::: CC: David S. Miller <davem@xxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip