LKML Archive on lore.kernel.org
 help / color / Atom feed
From: kernel test robot <lkp@intel.com>
To: Nick Desaulniers <ndesaulniers@google.com>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Jozsef Kadlecsik <kadlec@netfilter.org>,
	Florian Westphal <fw@strlen.de>
Cc: kbuild-all@lists.01.org,
	Nick Desaulniers <ndesaulniers@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Nathan Chancellor <natechancellor@gmail.com>,
	netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] netfilter: conntrack: fix -Wformat
Date: Mon, 9 Nov 2020 23:43:51 +0800
Message-ID: <202011092302.qLAPkxNU-lkp@intel.com> (raw)
In-Reply-To: <20201107075550.2244055-1-ndesaulniers@google.com>


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

Hi Nick,

I love your patch! Perhaps something to improve:

[auto build test WARNING on nf-next/master]
[also build test WARNING on nf/master ipvs/master v5.10-rc3 next-20201109]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Nick-Desaulniers/netfilter-conntrack-fix-Wformat/20201109-085104
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git master
config: riscv-randconfig-s031-20201109 (attached as .config)
compiler: riscv32-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://github.com/0day-ci/linux/commit/407a53117fa32f8f17a73a51bced0e85f168acb4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Nick-Desaulniers/netfilter-conntrack-fix-Wformat/20201109-085104
        git checkout 407a53117fa32f8f17a73a51bced0e85f168acb4
        # 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=riscv 

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 >>)"
>> net/netfilter/nf_conntrack_standalone.c:56:29: sparse: sparse: cast to restricted __be16
   net/netfilter/nf_conntrack_standalone.c:60:29: sparse: sparse: cast to restricted __be16
   net/netfilter/nf_conntrack_standalone.c:61:29: sparse: sparse: cast to restricted __be16
   net/netfilter/nf_conntrack_standalone.c:66:29: sparse: sparse: cast to restricted __be16
   net/netfilter/nf_conntrack_standalone.c:67:29: sparse: sparse: cast to restricted __be16
   net/netfilter/nf_conntrack_standalone.c:72:29: sparse: sparse: cast to restricted __be16
   net/netfilter/nf_conntrack_standalone.c:73:29: sparse: sparse: cast to restricted __be16
   net/netfilter/nf_conntrack_standalone.c:77:29: sparse: sparse: cast to restricted __be16
   net/netfilter/nf_conntrack_standalone.c:78:29: sparse: sparse: cast to restricted __be16
   net/netfilter/nf_conntrack_standalone.c:84:29: sparse: sparse: cast to restricted __be16

vim +56 net/netfilter/nf_conntrack_standalone.c

    32	
    33	#ifdef CONFIG_NF_CONNTRACK_PROCFS
    34	void
    35	print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple,
    36	            const struct nf_conntrack_l4proto *l4proto)
    37	{
    38		switch (tuple->src.l3num) {
    39		case NFPROTO_IPV4:
    40			seq_printf(s, "src=%pI4 dst=%pI4 ",
    41				   &tuple->src.u3.ip, &tuple->dst.u3.ip);
    42			break;
    43		case NFPROTO_IPV6:
    44			seq_printf(s, "src=%pI6 dst=%pI6 ",
    45				   tuple->src.u3.ip6, tuple->dst.u3.ip6);
    46			break;
    47		default:
    48			break;
    49		}
    50	
    51		switch (l4proto->l4proto) {
    52		case IPPROTO_ICMP:
    53			seq_printf(s, "type=%u code=%u id=%hu ",
    54				   tuple->dst.u.icmp.type,
    55				   tuple->dst.u.icmp.code,
  > 56				   (__be16)ntohs(tuple->src.u.icmp.id));
    57			break;
    58		case IPPROTO_TCP:
    59			seq_printf(s, "sport=%hu dport=%hu ",
    60				   (__be16)ntohs(tuple->src.u.tcp.port),
    61				   (__be16)ntohs(tuple->dst.u.tcp.port));
    62			break;
    63		case IPPROTO_UDPLITE:
    64		case IPPROTO_UDP:
    65			seq_printf(s, "sport=%hu dport=%hu ",
    66				   (__be16)ntohs(tuple->src.u.udp.port),
    67				   (__be16)ntohs(tuple->dst.u.udp.port));
    68	
    69			break;
    70		case IPPROTO_DCCP:
    71			seq_printf(s, "sport=%hu dport=%hu ",
    72				   (__be16)ntohs(tuple->src.u.dccp.port),
    73				   (__be16)ntohs(tuple->dst.u.dccp.port));
    74			break;
    75		case IPPROTO_SCTP:
    76			seq_printf(s, "sport=%hu dport=%hu ",
    77				   (__be16)ntohs(tuple->src.u.sctp.port),
    78				   (__be16)ntohs(tuple->dst.u.sctp.port));
    79			break;
    80		case IPPROTO_ICMPV6:
    81			seq_printf(s, "type=%u code=%u id=%hu ",
    82				   tuple->dst.u.icmp.type,
    83				   tuple->dst.u.icmp.code,
    84				   (__be16)ntohs(tuple->src.u.icmp.id));
    85			break;
    86		case IPPROTO_GRE:
    87			seq_printf(s, "srckey=0x%x dstkey=0x%x ",
    88				   ntohs(tuple->src.u.gre.key),
    89				   ntohs(tuple->dst.u.gre.key));
    90			break;
    91		default:
    92			break;
    93		}
    94	}
    95	EXPORT_SYMBOL_GPL(print_tuple);
    96	

---
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: 30080 bytes --]

      parent reply index

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-07  7:55 Nick Desaulniers
2020-11-07 10:32 ` Joe Perches
2020-11-08  7:34   ` Lukas Bulwahn
2020-11-08 10:10     ` Joe Perches
2020-11-10 22:00   ` Nick Desaulniers
2020-11-10 22:04     ` Joe Perches
2020-11-10 22:06       ` Nick Desaulniers
2020-12-02 22:34       ` Nick Desaulniers
2020-12-03  0:46         ` Tom Rix
2020-12-03  7:26           ` Lukas Bulwahn
2020-12-03 13:43             ` Miguel Ojeda
2020-12-03 14:40               ` Lukas Bulwahn
2020-12-03 14:39             ` Tom Rix
2020-12-03 16:45               ` Joe Perches
2020-12-13 19:21         ` Tom Rix
2020-12-13 23:25           ` Joe Perches
2020-12-13 23:29             ` Tom Rix
2020-11-07 17:52 ` Jakub Kicinski
2020-11-09 15:43 ` kernel test robot [this message]

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=202011092302.qLAPkxNU-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=coreteam@netfilter.org \
    --cc=fw@strlen.de \
    --cc=kadlec@netfilter.org \
    --cc=kbuild-all@lists.01.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git
	git clone --mirror https://lore.kernel.org/lkml/9 lkml/git/9.git
	git clone --mirror https://lore.kernel.org/lkml/10 lkml/git/10.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git