[nomadik:gemini-dir-685-rtl8366rb-dsa-find-magic-port 1/1] net/dsa/tag_rtl4_a.c:56:12: sparse: sparse: incorrect type in assignment (different base types)

kernel test robot lkp at intel.com
Tue Nov 3 09:54:31 EST 2020


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git gemini-dir-685-rtl8366rb-dsa-find-magic-port
head:   3076ea0568395d1484175d6a04c607ae688305b0
commit: 3076ea0568395d1484175d6a04c607ae688305b0 [1/1] Port tag on sending packets hack
config: sparc64-randconfig-s032-20201103 (attached as .config)
compiler: sparc64-linux-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-76-gf680124b-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git/commit/?id=3076ea0568395d1484175d6a04c607ae688305b0
        git remote add nomadik https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git
        git fetch --no-tags nomadik gemini-dir-685-rtl8366rb-dsa-find-magic-port
        git checkout 3076ea0568395d1484175d6a04c607ae688305b0
        # 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=sparc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>


"sparse warnings: (new ones prefixed by >>)"
>> net/dsa/tag_rtl4_a.c:56:12: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] @@     got restricted __be16 [usertype] @@
>> net/dsa/tag_rtl4_a.c:56:12: sparse:     expected unsigned short [usertype]
>> net/dsa/tag_rtl4_a.c:56:12: sparse:     got restricted __be16 [usertype]
   net/dsa/tag_rtl4_a.c:62:12: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] @@     got restricted __be16 [usertype] @@
   net/dsa/tag_rtl4_a.c:62:12: sparse:     expected unsigned short [usertype]
   net/dsa/tag_rtl4_a.c:62:12: sparse:     got restricted __be16 [usertype]

vim +56 net/dsa/tag_rtl4_a.c

    35	
    36	static struct sk_buff *rtl4a_tag_xmit(struct sk_buff *skb,
    37					      struct net_device *dev)
    38	{
    39		struct dsa_port *dp = dsa_slave_to_port(dev);
    40		u8 *tag;
    41		u16 *p;
    42		u16 out;
    43	
    44		if (skb_cow_head(skb, RTL4_A_HDR_LEN) < 0)
    45			return NULL;
    46	
    47		netdev_dbg(dev, "add realtek tag to package to port %d\n",
    48			   dp->index);
    49		skb_push(skb, RTL4_A_HDR_LEN);
    50	
    51		memmove(skb->data, skb->data + RTL4_A_HDR_LEN, 2 * ETH_ALEN);
    52		tag = skb->data + 2 * ETH_ALEN;
    53	
    54		/* Set Ethertype */
    55		p = (u16 *)tag;
  > 56		*p = htons(RTL4_A_ETHERTYPE);
    57	
    58		out = (RTL4_A_PROTOCOL_RTL8366RB << 12) | (2 << 8);
    59		/* The lower bits is the port numer */
    60		out |= (u8)dp->index;
    61		p = (u16 *)(tag + 2);
    62		*p = htons(out);
    63	
    64		return skb;
    65	}
    66	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 34579 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20201103/efbfcfb4/attachment-0001.gz>


More information about the linux-arm-kernel mailing list