drivers/net/ethernet/mediatek/mtk_eth_soc.c:2237:38: sparse: sparse: incorrect type in assignment (different base types)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0cfd8703e7da687924371e9bc77a025bdeba9637
commit: d30dfd490f7dc4cb6a7c11a647bd1ff7a22139e7 include/uapi/linux/swab.h: move explicit cast outside ternary
date:   10 months ago
config: alpha-randconfig-s032-20230426 (https://download.01.org/0day-ci/archive/20230427/202304270116.SvhuHUfR-lkp@xxxxxxxxx/config)
compiler: alpha-linux-gcc (GCC) 12.1.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.4-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d30dfd490f7dc4cb6a7c11a647bd1ff7a22139e7
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout d30dfd490f7dc4cb6a7c11a647bd1ff7a22139e7
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha SHELL=/bin/bash drivers/net/ethernet/mediatek/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Link: https://lore.kernel.org/oe-kbuild-all/202304270116.SvhuHUfR-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:1371:45: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __sum16 [usertype] check @@     got restricted __be16 [usertype] @@
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:1371:45: sparse:     expected restricted __sum16 [usertype] check
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:1371:45: sparse:     got restricted __be16 [usertype]
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2132:22: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected unsigned int [usertype] val @@     got restricted __be32 [usertype] ip @@
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2132:22: sparse:     expected unsigned int [usertype] val
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2132:22: sparse:     got restricted __be32 [usertype] ip
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2177:40: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] val @@     got restricted __be32 [usertype] ip4dst @@
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2177:40: sparse:     expected unsigned int [usertype] val
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2177:40: sparse:     got restricted __be32 [usertype] ip4dst
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2177:40: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2177:40: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2177:40: sparse: sparse: cast from restricted __be32
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2177:40: sparse: sparse: cast from restricted __be32
>> drivers/net/ethernet/mediatek/mtk_eth_soc.c:2237:38: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be32 [usertype] ip4dst @@     got unsigned int [usertype] @@
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2237:38: sparse:     expected restricted __be32 [usertype] ip4dst
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2237:38: sparse:     got unsigned int [usertype]
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2241:38: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be32 [usertype] ip4src @@     got unsigned int @@
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2241:38: sparse:     expected restricted __be32 [usertype] ip4src
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2241:38: sparse:     got unsigned int
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2243:36: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [usertype] psrc @@     got int @@
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2243:36: sparse:     expected restricted __be16 [usertype] psrc
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2243:36: sparse:     got int
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2245:36: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [usertype] pdst @@     got int @@
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2245:36: sparse:     expected restricted __be16 [usertype] pdst
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:2245:36: sparse:     got int
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:820:9: sparse: sparse: context imbalance in 'mtk_stats_update' - different lock contexts for basic block
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:845:50: sparse: sparse: context imbalance in 'mtk_get_stats64' - wrong count at exit
   drivers/net/ethernet/mediatek/mtk_eth_soc.c:3145:13: sparse: sparse: context imbalance in 'mtk_get_ethtool_stats' - different lock contexts for basic block

vim +2237 drivers/net/ethernet/mediatek/mtk_eth_soc.c

7aab747e5563ec Nelson Chang  2016-09-17  2224  
7aab747e5563ec Nelson Chang  2016-09-17  2225  static int mtk_hwlro_get_fdir_entry(struct net_device *dev,
7aab747e5563ec Nelson Chang  2016-09-17  2226  				    struct ethtool_rxnfc *cmd)
7aab747e5563ec Nelson Chang  2016-09-17  2227  {
7aab747e5563ec Nelson Chang  2016-09-17  2228  	struct mtk_mac *mac = netdev_priv(dev);
7aab747e5563ec Nelson Chang  2016-09-17  2229  	struct ethtool_rx_flow_spec *fsp =
7aab747e5563ec Nelson Chang  2016-09-17  2230  		(struct ethtool_rx_flow_spec *)&cmd->fs;
7aab747e5563ec Nelson Chang  2016-09-17  2231  
e7e7104e2d5ddf Dan Carpenter 2022-05-26  2232  	if (fsp->location >= ARRAY_SIZE(mac->hwlro_ip))
e7e7104e2d5ddf Dan Carpenter 2022-05-26  2233  		return -EINVAL;
e7e7104e2d5ddf Dan Carpenter 2022-05-26  2234  
7aab747e5563ec Nelson Chang  2016-09-17  2235  	/* only tcp dst ipv4 is meaningful, others are meaningless */
7aab747e5563ec Nelson Chang  2016-09-17  2236  	fsp->flow_type = TCP_V4_FLOW;
7aab747e5563ec Nelson Chang  2016-09-17 @2237  	fsp->h_u.tcp_ip4_spec.ip4dst = ntohl(mac->hwlro_ip[fsp->location]);
7aab747e5563ec Nelson Chang  2016-09-17  2238  	fsp->m_u.tcp_ip4_spec.ip4dst = 0;
7aab747e5563ec Nelson Chang  2016-09-17  2239  
7aab747e5563ec Nelson Chang  2016-09-17  2240  	fsp->h_u.tcp_ip4_spec.ip4src = 0;
7aab747e5563ec Nelson Chang  2016-09-17  2241  	fsp->m_u.tcp_ip4_spec.ip4src = 0xffffffff;
7aab747e5563ec Nelson Chang  2016-09-17  2242  	fsp->h_u.tcp_ip4_spec.psrc = 0;
7aab747e5563ec Nelson Chang  2016-09-17  2243  	fsp->m_u.tcp_ip4_spec.psrc = 0xffff;
7aab747e5563ec Nelson Chang  2016-09-17  2244  	fsp->h_u.tcp_ip4_spec.pdst = 0;
7aab747e5563ec Nelson Chang  2016-09-17  2245  	fsp->m_u.tcp_ip4_spec.pdst = 0xffff;
7aab747e5563ec Nelson Chang  2016-09-17  2246  	fsp->h_u.tcp_ip4_spec.tos = 0;
7aab747e5563ec Nelson Chang  2016-09-17  2247  	fsp->m_u.tcp_ip4_spec.tos = 0xff;
7aab747e5563ec Nelson Chang  2016-09-17  2248  
7aab747e5563ec Nelson Chang  2016-09-17  2249  	return 0;
7aab747e5563ec Nelson Chang  2016-09-17  2250  }
7aab747e5563ec Nelson Chang  2016-09-17  2251  

:::::: The code at line 2237 was first introduced by commit
:::::: 7aab747e5563ecbc9f3cb64ddea13fe7b9fee2bd net: ethernet: mediatek: add ethtool functions to configure RX flows of HW LRO

:::::: TO: Nelson Chang <nelson.chang@xxxxxxxxxxxx>
:::::: CC: David S. Miller <davem@xxxxxxxxxxxxx>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux