linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [linux-next:master 3601/7050] net/netfilter/nft_tunnel.c:376:30: sparse: sparse: incorrect type in assignment (different base types)
Date: Sun, 8 Mar 2020 04:51:08 +0800	[thread overview]
Message-ID: <202003080405.J2cv93rA%lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   b86a6a241b7c60ca7a6ca4fb3c0d2aedbbf2c1b6
commit: e984c5a18b709f38ce85ded16b125fc79abf0ff5 [3601/7050] netfilter: nft_tunnel: add support for geneve opts
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-174-g094d5a94-dirty
        git checkout e984c5a18b709f38ce85ded16b125fc79abf0ff5
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

>> net/netfilter/nft_tunnel.c:376:30: sparse: sparse: incorrect type in assignment (different base types) @@    expected int type @@    got restricted __be16 [usertyint type @@
   net/netfilter/nft_tunnel.c:376:30: sparse:    expected int type
   net/netfilter/nft_tunnel.c:376:30: sparse:    got restricted __be16 [usertype]
   net/netfilter/nft_tunnel.c:384:30: sparse: sparse: incorrect type in assignment (different base types) @@    expected int type @@    got restricted __be16 [usertyint type @@
   net/netfilter/nft_tunnel.c:384:30: sparse:    expected int type
   net/netfilter/nft_tunnel.c:384:30: sparse:    got restricted __be16 [usertype]
   net/netfilter/nft_tunnel.c:387:45: sparse: sparse: restricted __be16 degrades to integer
   net/netfilter/nft_tunnel.c:392:30: sparse: sparse: incorrect type in assignment (different base types) @@    expected int type @@    got restricted __be16 [usertyint type @@
   net/netfilter/nft_tunnel.c:392:30: sparse:    expected int type
   net/netfilter/nft_tunnel.c:392:30: sparse:    got restricted __be16 [usertype]

vim +376 net/netfilter/nft_tunnel.c

   354	
   355	static int nft_tunnel_obj_opts_init(const struct nft_ctx *ctx,
   356					    const struct nlattr *attr,
   357					    struct ip_tunnel_info *info,
   358					    struct nft_tunnel_opts *opts)
   359	{
   360		int err, rem, type = 0;
   361		struct nlattr *nla;
   362	
   363		err = nla_validate_nested_deprecated(attr, NFTA_TUNNEL_KEY_OPTS_MAX,
   364						     nft_tunnel_opts_policy, NULL);
   365		if (err < 0)
   366			return err;
   367	
   368		nla_for_each_attr(nla, nla_data(attr), nla_len(attr), rem) {
   369			switch (nla_type(nla)) {
   370			case NFTA_TUNNEL_KEY_OPTS_VXLAN:
   371				if (type)
   372					return -EINVAL;
   373				err = nft_tunnel_obj_vxlan_init(nla, opts);
   374				if (err)
   375					return err;
 > 376				type = TUNNEL_VXLAN_OPT;
   377				break;
   378			case NFTA_TUNNEL_KEY_OPTS_ERSPAN:
   379				if (type)
   380					return -EINVAL;
   381				err = nft_tunnel_obj_erspan_init(nla, opts);
   382				if (err)
   383					return err;
   384				type = TUNNEL_ERSPAN_OPT;
   385				break;
   386			case NFTA_TUNNEL_KEY_OPTS_GENEVE:
   387				if (type && type != TUNNEL_GENEVE_OPT)
   388					return -EINVAL;
   389				err = nft_tunnel_obj_geneve_init(nla, opts);
   390				if (err)
   391					return err;
   392				type = TUNNEL_GENEVE_OPT;
   393				break;
   394			default:
   395				return -EOPNOTSUPP;
   396			}
   397		}
   398	
   399		return err;
   400	}
   401	

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


                 reply	other threads:[~2020-03-07 20:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202003080405.J2cv93rA%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox