Hi Nikita,

Thank you for the patch! Perhaps something to improve:

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

url:    
https://github.com/0day-ci/linux/commits/Nikita-V-Shirokov/introduction-of-bpf_xdp_adjust_tail/20180417-211905
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: i386-randconfig-s1-201815 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   net/core/filter.c: In function '____bpf_xdp_adjust_tail':
>> net/core/filter.c:2726:2: warning: ISO C90 forbids mixed declarations and 
>> code [-Wdeclaration-after-statement]
     void *data_end = xdp->data_end + offset;
     ^~~~

vim +2726 net/core/filter.c

  2719  
  2720  BPF_CALL_2(bpf_xdp_adjust_tail, struct xdp_buff *, xdp, int, offset)
  2721  {
  2722          /* only shrinking is allowed for now. */
  2723          if (unlikely(offset > 0))
  2724                  return -EINVAL;
  2725  
> 2726          void *data_end = xdp->data_end + offset;
  2727  
  2728          if (unlikely(data_end < xdp->data + ETH_HLEN))
  2729                  return -EINVAL;
  2730  
  2731          xdp->data_end = data_end;
  2732  
  2733          return 0;
  2734  }
  2735  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to