[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    drivers/net/usb/lan78xx.c:2963:27: sparse: sparse: incorrect type in assignment (different base type
From:       kernel test robot <lkp () intel ! com>
Date:       2021-12-31 20:42:05
Message-ID: 202201010449.pwZ9p571-lkp () intel ! com
[Download RAW message or body]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4f3d93c6eaff6b84e43b63e0d7a119c5920e1020
commit: d991bb1c8da842a2a0b9dc83b1005e655783f861 include/linux/compiler-gcc.h: sparse \
                can do constant folding of __builtin_bswap*()
date:   8 months ago
config: i386-randconfig-s002-20211123 \
(https://download.01.org/0day-ci/archive/20220101/202201010449.pwZ9p571-lkp@intel.com/config)
                
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d991bb1c8da842a2a0b9dc83b1005e655783f861
                
        git remote add linus \
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git  git fetch \
--no-tags linus master  git checkout d991bb1c8da842a2a0b9dc83b1005e655783f861
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir \
ARCH=i386 SHELL=/bin/bash

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/net/usb/lan78xx.c:2963:29: sparse: sparse: cast to restricted __be16
> > drivers/net/usb/lan78xx.c:2963:27: sparse: sparse: incorrect type in assignment \
> > (different base types) @@     expected restricted __wsum [usertype] csum @@     \
> > got unsigned short [usertype] @@
   drivers/net/usb/lan78xx.c:2963:27: sparse:     expected restricted __wsum \
[usertype] csum  drivers/net/usb/lan78xx.c:2963:27: sparse:     got unsigned short \
[usertype]

vim +2963 drivers/net/usb/lan78xx.c

55d7de9de6c30a Woojung.Huh@microchip.com 2015-07-30  2949  
55d7de9de6c30a Woojung.Huh@microchip.com 2015-07-30  2950  static void \
lan78xx_rx_csum_offload(struct lan78xx_net *dev, 55d7de9de6c30a \
Woojung.Huh@microchip.com 2015-07-30  2951  				    struct sk_buff *skb, \
55d7de9de6c30a Woojung.Huh@microchip.com 2015-07-30  2952  				    u32 rx_cmd_a, u32 \
rx_cmd_b) 55d7de9de6c30a Woojung.Huh@microchip.com 2015-07-30  2953  {
9343ac87f2a4e0 Dave Stevenson            2018-06-25  2954  	/* HW Checksum offload \
appears to be flawed if used when not stripping 9343ac87f2a4e0 Dave Stevenson         \
2018-06-25  2955  	 * VLAN headers. Drop back to S/W checksums under these \
conditions. 9343ac87f2a4e0 Dave Stevenson            2018-06-25  2956  	 */
55d7de9de6c30a Woojung.Huh@microchip.com 2015-07-30  2957  	if (!(dev->net->features \
& NETIF_F_RXCSUM) || 9343ac87f2a4e0 Dave Stevenson            2018-06-25  2958  	    \
unlikely(rx_cmd_a & RX_CMD_A_ICSM_) || 9343ac87f2a4e0 Dave Stevenson            \
2018-06-25  2959  	    ((rx_cmd_a & RX_CMD_A_FVTG_) && 9343ac87f2a4e0 Dave Stevenson  \
2018-06-25  2960  	     !(dev->net->features & NETIF_F_HW_VLAN_CTAG_RX))) { \
55d7de9de6c30a Woojung.Huh@microchip.com 2015-07-30  2961  		skb->ip_summed = \
CHECKSUM_NONE; 55d7de9de6c30a Woojung.Huh@microchip.com 2015-07-30  2962  	} else {
55d7de9de6c30a Woojung.Huh@microchip.com 2015-07-30 @2963  		skb->csum = \
ntohs((u16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT_)); 55d7de9de6c30a \
Woojung.Huh@microchip.com 2015-07-30  2964  		skb->ip_summed = CHECKSUM_COMPLETE; \
55d7de9de6c30a Woojung.Huh@microchip.com 2015-07-30  2965  	} 55d7de9de6c30a \
Woojung.Huh@microchip.com 2015-07-30  2966  } 55d7de9de6c30a \
Woojung.Huh@microchip.com 2015-07-30  2967  

> > > > > > The code at line 2963 was first introduced by commit
> > > > > > 55d7de9de6c30adce8d675c7ce513e283829c2ff Microchip's LAN7800 family USB \
> > > > > > 2/3 to 10/100/1000 Ethernet device driver

> > > > > > TO: Woojung.Huh@microchip.com <Woojung.Huh@microchip.com>
> > > > > > CC: David S. Miller <davem@davemloft.net>

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic