All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jose Abreu <Jose.Abreu@synopsys.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:975:27: sparse: sparse: incorrect type in assignment (different base types)
Date: Fri, 24 Jul 2020 11:21:47 +0800	[thread overview]
Message-ID: <202007241143.BnFHYux7%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4161 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d15be546031cf65a0fc34879beca02fd90fe7ac7
commit: ccfc639a94f25eb8639e8ffbecad2f6b60d22eb1 net: stmmac: selftests: Add a selftest for Flexible RX Parser
date:   12 months ago
config: powerpc-randconfig-s032-20200723 (attached as .config)
compiler: powerpc-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.2-93-g4c6cbe55-dirty
        git checkout ccfc639a94f25eb8639e8ffbecad2f6b60d22eb1
        # 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=powerpc 

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/ethernet/stmicro/stmmac/stmmac_selftests.c:975:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be32 [usertype] mask @@     got int @@
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:975:27: sparse:     expected restricted __be32 [usertype] mask
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:975:27: sparse:     got int

vim +975 drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c

   916	
   917	#ifdef CONFIG_NET_CLS_ACT
   918	static int stmmac_test_rxp(struct stmmac_priv *priv)
   919	{
   920		unsigned char addr[ETH_ALEN] = {0xde, 0xad, 0xbe, 0xef, 0x00, 0x00};
   921		struct tc_cls_u32_offload cls_u32 = { };
   922		struct stmmac_packet_attrs attr = { };
   923		struct tc_action **actions, *act;
   924		struct tc_u32_sel *sel;
   925		struct tcf_exts *exts;
   926		int ret, i, nk = 1;
   927	
   928		if (!tc_can_offload(priv->dev))
   929			return -EOPNOTSUPP;
   930		if (!priv->dma_cap.frpsel)
   931			return -EOPNOTSUPP;
   932	
   933		sel = kzalloc(sizeof(*sel) + nk * sizeof(struct tc_u32_key), GFP_KERNEL);
   934		if (!sel)
   935			return -ENOMEM;
   936	
   937		exts = kzalloc(sizeof(*exts), GFP_KERNEL);
   938		if (!exts) {
   939			ret = -ENOMEM;
   940			goto cleanup_sel;
   941		}
   942	
   943		actions = kzalloc(nk * sizeof(*actions), GFP_KERNEL);
   944		if (!actions) {
   945			ret = -ENOMEM;
   946			goto cleanup_exts;
   947		}
   948	
   949		act = kzalloc(nk * sizeof(*act), GFP_KERNEL);
   950		if (!act) {
   951			ret = -ENOMEM;
   952			goto cleanup_actions;
   953		}
   954	
   955		cls_u32.command = TC_CLSU32_NEW_KNODE;
   956		cls_u32.common.chain_index = 0;
   957		cls_u32.common.protocol = htons(ETH_P_ALL);
   958		cls_u32.knode.exts = exts;
   959		cls_u32.knode.sel = sel;
   960		cls_u32.knode.handle = 0x123;
   961	
   962		exts->nr_actions = nk;
   963		exts->actions = actions;
   964		for (i = 0; i < nk; i++) {
   965			struct tcf_gact *gact = to_gact(&act[i]);
   966	
   967			actions[i] = &act[i];
   968			gact->tcf_action = TC_ACT_SHOT;
   969		}
   970	
   971		sel->nkeys = nk;
   972		sel->offshift = 0;
   973		sel->keys[0].off = 6;
   974		sel->keys[0].val = htonl(0xdeadbeef);
 > 975		sel->keys[0].mask = ~0x0;
   976	
   977		ret = stmmac_tc_setup_cls_u32(priv, priv, &cls_u32);
   978		if (ret)
   979			goto cleanup_act;
   980	
   981		attr.dst = priv->dev->dev_addr;
   982		attr.src = addr;
   983	
   984		ret = __stmmac_test_loopback(priv, &attr);
   985		ret = !ret; /* Shall NOT receive packet */
   986	
   987		cls_u32.command = TC_CLSU32_DELETE_KNODE;
   988		stmmac_tc_setup_cls_u32(priv, priv, &cls_u32);
   989	
   990	cleanup_act:
   991		kfree(act);
   992	cleanup_actions:
   993		kfree(actions);
   994	cleanup_exts:
   995		kfree(exts);
   996	cleanup_sel:
   997		kfree(sel);
   998		return ret;
   999	}
  1000	#else
  1001	static int stmmac_test_rxp(struct stmmac_priv *priv)
  1002	{
  1003		return -EOPNOTSUPP;
  1004	}
  1005	#endif
  1006	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27824 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:975:27: sparse: sparse: incorrect type in assignment (different base types)
Date: Fri, 24 Jul 2020 11:21:47 +0800	[thread overview]
Message-ID: <202007241143.BnFHYux7%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4285 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d15be546031cf65a0fc34879beca02fd90fe7ac7
commit: ccfc639a94f25eb8639e8ffbecad2f6b60d22eb1 net: stmmac: selftests: Add a selftest for Flexible RX Parser
date:   12 months ago
config: powerpc-randconfig-s032-20200723 (attached as .config)
compiler: powerpc-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.2-93-g4c6cbe55-dirty
        git checkout ccfc639a94f25eb8639e8ffbecad2f6b60d22eb1
        # 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=powerpc 

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/ethernet/stmicro/stmmac/stmmac_selftests.c:975:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be32 [usertype] mask @@     got int @@
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:975:27: sparse:     expected restricted __be32 [usertype] mask
   drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:975:27: sparse:     got int

vim +975 drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c

   916	
   917	#ifdef CONFIG_NET_CLS_ACT
   918	static int stmmac_test_rxp(struct stmmac_priv *priv)
   919	{
   920		unsigned char addr[ETH_ALEN] = {0xde, 0xad, 0xbe, 0xef, 0x00, 0x00};
   921		struct tc_cls_u32_offload cls_u32 = { };
   922		struct stmmac_packet_attrs attr = { };
   923		struct tc_action **actions, *act;
   924		struct tc_u32_sel *sel;
   925		struct tcf_exts *exts;
   926		int ret, i, nk = 1;
   927	
   928		if (!tc_can_offload(priv->dev))
   929			return -EOPNOTSUPP;
   930		if (!priv->dma_cap.frpsel)
   931			return -EOPNOTSUPP;
   932	
   933		sel = kzalloc(sizeof(*sel) + nk * sizeof(struct tc_u32_key), GFP_KERNEL);
   934		if (!sel)
   935			return -ENOMEM;
   936	
   937		exts = kzalloc(sizeof(*exts), GFP_KERNEL);
   938		if (!exts) {
   939			ret = -ENOMEM;
   940			goto cleanup_sel;
   941		}
   942	
   943		actions = kzalloc(nk * sizeof(*actions), GFP_KERNEL);
   944		if (!actions) {
   945			ret = -ENOMEM;
   946			goto cleanup_exts;
   947		}
   948	
   949		act = kzalloc(nk * sizeof(*act), GFP_KERNEL);
   950		if (!act) {
   951			ret = -ENOMEM;
   952			goto cleanup_actions;
   953		}
   954	
   955		cls_u32.command = TC_CLSU32_NEW_KNODE;
   956		cls_u32.common.chain_index = 0;
   957		cls_u32.common.protocol = htons(ETH_P_ALL);
   958		cls_u32.knode.exts = exts;
   959		cls_u32.knode.sel = sel;
   960		cls_u32.knode.handle = 0x123;
   961	
   962		exts->nr_actions = nk;
   963		exts->actions = actions;
   964		for (i = 0; i < nk; i++) {
   965			struct tcf_gact *gact = to_gact(&act[i]);
   966	
   967			actions[i] = &act[i];
   968			gact->tcf_action = TC_ACT_SHOT;
   969		}
   970	
   971		sel->nkeys = nk;
   972		sel->offshift = 0;
   973		sel->keys[0].off = 6;
   974		sel->keys[0].val = htonl(0xdeadbeef);
 > 975		sel->keys[0].mask = ~0x0;
   976	
   977		ret = stmmac_tc_setup_cls_u32(priv, priv, &cls_u32);
   978		if (ret)
   979			goto cleanup_act;
   980	
   981		attr.dst = priv->dev->dev_addr;
   982		attr.src = addr;
   983	
   984		ret = __stmmac_test_loopback(priv, &attr);
   985		ret = !ret; /* Shall NOT receive packet */
   986	
   987		cls_u32.command = TC_CLSU32_DELETE_KNODE;
   988		stmmac_tc_setup_cls_u32(priv, priv, &cls_u32);
   989	
   990	cleanup_act:
   991		kfree(act);
   992	cleanup_actions:
   993		kfree(actions);
   994	cleanup_exts:
   995		kfree(exts);
   996	cleanup_sel:
   997		kfree(sel);
   998		return ret;
   999	}
  1000	#else
  1001	static int stmmac_test_rxp(struct stmmac_priv *priv)
  1002	{
  1003		return -EOPNOTSUPP;
  1004	}
  1005	#endif
  1006	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 27824 bytes --]

             reply	other threads:[~2020-07-24  3:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24  3:21 kernel test robot [this message]
2020-07-24  3:21 ` drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:975:27: sparse: sparse: incorrect type in assignment (different base types) kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2020-06-21 10:28 kernel test robot
2020-06-21 10:28 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202007241143.BnFHYux7%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.