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: x86_64-randconfig-s021-20220509 (https://download.01.org/0day-ci/archive/20220512/202205121018.gtq8d3pp-lkp@xxxxxxxxx/config) compiler: gcc-11 (Debian 11.2.0-20) 11.2.0 reproduce: # apt-get install sparse # sparse version: v0.6.4-dirty # 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 make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> sparse warnings: (new ones prefixed by >>) >> net/netfilter/nft_bitwise.c:306:28: sparse: sparse: incorrect type in assignment (different modifiers) @@ expected struct nft_expr *cur @@ got struct nft_expr const *expr @@ net/netfilter/nft_bitwise.c:306:28: sparse: expected struct nft_expr *cur net/netfilter/nft_bitwise.c:306:28: sparse: got struct nft_expr const *expr net/netfilter/nft_bitwise.c:454:28: sparse: sparse: incorrect type in assignment (different modifiers) @@ expected struct nft_expr *cur @@ got struct nft_expr const *expr @@ net/netfilter/nft_bitwise.c:454:28: sparse: expected struct nft_expr *cur net/netfilter/nft_bitwise.c:454:28: sparse: got struct nft_expr const *expr vim +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