Hi Stephen,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on nf/master]

url:    
https://github.com/0day-ci/linux/commits/Stephen-Suryaputra/netfilter-nf_tables-nft_exthdr-the-presence-return-value-should-be-little-endian/20200804-055723
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git master
config: openrisc-randconfig-s032-20200804 (attached as .config)
compiler: or1k-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-117-g8c7aee71-dirty
        # 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=openrisc 

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


sparse warnings: (new ones prefixed by >>)

>> net/netfilter/nft_exthdr.c:47:23: sparse: sparse: incorrect type in 
>> assignment (different base types) @@     expected unsigned int [usertype] @@ 
>>     got restricted __le32 [usertype] @@
>> net/netfilter/nft_exthdr.c:47:23: sparse:     expected unsigned int 
>> [usertype]
>> net/netfilter/nft_exthdr.c:47:23: sparse:     got restricted __le32 
>> [usertype]
   net/netfilter/nft_exthdr.c:144:23: sparse: sparse: incorrect type in 
assignment (different base types) @@     expected unsigned int [usertype] @@    
 got restricted __le32 [usertype] @@
   net/netfilter/nft_exthdr.c:144:23: sparse:     expected unsigned int 
[usertype]
   net/netfilter/nft_exthdr.c:144:23: sparse:     got restricted __le32 
[usertype]
   net/netfilter/nft_exthdr.c:264:33: sparse: sparse: incorrect type in 
assignment (different base types) @@     expected restricted __be16 [usertype] 
v16 @@     got unsigned short @@
   net/netfilter/nft_exthdr.c:264:33: sparse:     expected restricted __be16 
[usertype] v16
   net/netfilter/nft_exthdr.c:264:33: sparse:     got unsigned short
   net/netfilter/nft_exthdr.c:284:33: sparse: sparse: incorrect type in 
assignment (different base types) @@     expected restricted __be32 [assigned] 
[usertype] v32 @@     got unsigned int @@
   net/netfilter/nft_exthdr.c:284:33: sparse:     expected restricted __be32 
[assigned] [usertype] v32
   net/netfilter/nft_exthdr.c:284:33: sparse:     got unsigned int
   net/netfilter/nft_exthdr.c:285:33: sparse: sparse: incorrect type in 
assignment (different base types) @@     expected restricted __be32 [usertype] 
v32 @@     got unsigned int @@
   net/netfilter/nft_exthdr.c:285:33: sparse:     expected restricted __be32 
[usertype] v32
   net/netfilter/nft_exthdr.c:285:33: sparse:     got unsigned int

vim +47 net/netfilter/nft_exthdr.c

    35  
    36  static void nft_exthdr_ipv6_eval(const struct nft_expr *expr,
    37                                   struct nft_regs *regs,
    38                                   const struct nft_pktinfo *pkt)
    39  {
    40          struct nft_exthdr *priv = nft_expr_priv(expr);
    41          u32 *dest = &regs->data[priv->dreg];
    42          unsigned int offset = 0;
    43          int err;
    44  
    45          err = ipv6_find_hdr(pkt->skb, &offset, priv->type, NULL, NULL);
    46          if (priv->flags & NFT_EXTHDR_F_PRESENT) {
  > 47                  *dest = cpu_to_le32(err >= 0);
    48                  return;
    49          } else if (err < 0) {
    50                  goto err;
    51          }
    52          offset += priv->offset;
    53  
    54          dest[priv->len / NFT_REG32_SIZE] = 0;
    55          if (skb_copy_bits(pkt->skb, offset, dest, priv->len) < 0)
    56                  goto err;
    57          return;
    58  err:
    59          regs->verdict.code = NFT_BREAK;
    60  }
    61  

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

Attachment: .config.gz
Description: application/gzip

Reply via email to