All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Phil Sutter <phil@nwl.cc>, Pablo Neira Ayuso <pablo@netfilter.org>
Cc: kbuild-all@lists.01.org, netfilter-devel@vger.kernel.org
Subject: Re: [nf-next PATCH 2/2] netfilter: nf_tables: Annotate reduced expressions
Date: Thu, 12 May 2022 09:39:57 +0800	[thread overview]
Message-ID: <202205120906.nNquMTSm-lkp@intel.com> (raw)
In-Reply-To: <20220511165453.22425-3-phil@nwl.cc>

Hi Phil,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on nf-next/master]

url:    https://github.com/intel-lab-lkp/linux/commits/Phil-Sutter/nf_tables-Export-rule-optimizer-results-to-user-space/20220512-005642
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git master
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20220512/202205120906.nNquMTSm-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/831b99f09285d0cc3a4fb0fcb6fd7c74aaea988a
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Phil-Sutter/nf_tables-Export-rule-optimizer-results-to-user-space/20220512-005642
        git checkout 831b99f09285d0cc3a4fb0fcb6fd7c74aaea988a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash net/netfilter/

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

All warnings (new ones prefixed by >>):

   net/netfilter/nft_bitwise.c: In function 'nft_bitwise_reduce':
>> net/netfilter/nft_bitwise.c:306:28: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     306 |                 track->cur = expr;
         |                            ^
   net/netfilter/nft_bitwise.c: In function 'nft_bitwise_fast_reduce':
   net/netfilter/nft_bitwise.c:454:28: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     454 |                 track->cur = expr;
         |                            ^


vim +/const +306 net/netfilter/nft_bitwise.c

bd8699e9e29287 Pablo Neira Ayuso 2019-07-30  281  
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  282  static bool nft_bitwise_reduce(struct nft_regs_track *track,
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  283  			       const struct nft_expr *expr)
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  284  {
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  285  	const struct nft_bitwise *priv = nft_expr_priv(expr);
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  286  	const struct nft_bitwise *bitwise;
34cc9e52884a16 Pablo Neira Ayuso 2022-03-14  287  	unsigned int regcount;
34cc9e52884a16 Pablo Neira Ayuso 2022-03-14  288  	u8 dreg;
34cc9e52884a16 Pablo Neira Ayuso 2022-03-14  289  	int i;
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  290  
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  291  	if (!track->regs[priv->sreg].selector)
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  292  		return false;
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  293  
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  294  	bitwise = nft_expr_priv(expr);
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  295  	if (track->regs[priv->sreg].selector == track->regs[priv->dreg].selector &&
34cc9e52884a16 Pablo Neira Ayuso 2022-03-14  296  	    track->regs[priv->sreg].num_reg == 0 &&
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  297  	    track->regs[priv->dreg].bitwise &&
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  298  	    track->regs[priv->dreg].bitwise->ops == expr->ops &&
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  299  	    priv->sreg == bitwise->sreg &&
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  300  	    priv->dreg == bitwise->dreg &&
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  301  	    priv->op == bitwise->op &&
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  302  	    priv->len == bitwise->len &&
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  303  	    !memcmp(&priv->mask, &bitwise->mask, sizeof(priv->mask)) &&
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  304  	    !memcmp(&priv->xor, &bitwise->xor, sizeof(priv->xor)) &&
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  305  	    !memcmp(&priv->data, &bitwise->data, sizeof(priv->data))) {
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09 @306  		track->cur = expr;
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  307  		return true;
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  308  	}
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  309  
34cc9e52884a16 Pablo Neira Ayuso 2022-03-14  310  	if (track->regs[priv->sreg].bitwise ||
34cc9e52884a16 Pablo Neira Ayuso 2022-03-14  311  	    track->regs[priv->sreg].num_reg != 0) {
34cc9e52884a16 Pablo Neira Ayuso 2022-03-14  312  		nft_reg_track_cancel(track, priv->dreg, priv->len);
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  313  		return false;
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  314  	}
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  315  
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  316  	if (priv->sreg != priv->dreg) {
34cc9e52884a16 Pablo Neira Ayuso 2022-03-14  317  		nft_reg_track_update(track, track->regs[priv->sreg].selector,
34cc9e52884a16 Pablo Neira Ayuso 2022-03-14  318  				     priv->dreg, priv->len);
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  319  	}
34cc9e52884a16 Pablo Neira Ayuso 2022-03-14  320  
34cc9e52884a16 Pablo Neira Ayuso 2022-03-14  321  	dreg = priv->dreg;
34cc9e52884a16 Pablo Neira Ayuso 2022-03-14  322  	regcount = DIV_ROUND_UP(priv->len, NFT_REG32_SIZE);
34cc9e52884a16 Pablo Neira Ayuso 2022-03-14  323  	for (i = 0; i < regcount; i++, dreg++)
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  324  		track->regs[priv->dreg].bitwise = expr;
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  325  
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  326  	return false;
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  327  }
be5650f8f47e8c Pablo Neira Ayuso 2022-01-09  328  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

  parent reply	other threads:[~2022-05-12  1:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-11 16:54 [nf-next PATCH 0/2] nf_tables: Export rule optimizer results to user space Phil Sutter
2022-05-11 16:54 ` [nf-next PATCH 1/2] netfilter: nf_tables: Introduce expression flags Phil Sutter
2022-05-11 16:54 ` [nf-next PATCH 2/2] netfilter: nf_tables: Annotate reduced expressions Phil Sutter
2022-05-11 23:37   ` kernel test robot
2022-05-12  1:39   ` kernel test robot [this message]
2022-05-12  3:01   ` 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=202205120906.nNquMTSm-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=phil@nwl.cc \
    /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.