Hi "Toke,

I love your patch! Perhaps something to improve:

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

url:    
https://github.com/0day-ci/linux/commits/Toke-H-iland-J-rgensen/inet_ecn-Use-csum16_add-helper-for-IP_ECN_set_-helpers/20201211-071305
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 
51e13685bd93654e0e9b2559c8e103d6545ddf95
config: i386-randconfig-s001-20201209 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-179-ga00755aa-dirty
        # 
https://github.com/0day-ci/linux/commit/30ca3d0f48b3d72f9ca0a3509eb63956484d02ad
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review 
Toke-H-iland-J-rgensen/inet_ecn-Use-csum16_add-helper-for-IP_ECN_set_-helpers/20201211-071305
        git checkout 30ca3d0f48b3d72f9ca0a3509eb63956484d02ad
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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/sched/sch_fq.c: note: in included file (through include/net/tcp.h):
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
--
   net/sched/sch_sfq.c: note: in included file (through include/net/red.h):
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
--
   net/sched/sch_sfb.c: note: in included file:
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
--
   net/sched/sch_fq_codel.c: note: in included file (through 
include/net/codel.h):
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
--
   net/sched/sch_choke.c: note: in included file:
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
--
   net/sched/sch_codel.c: note: in included file (through include/net/codel.h):
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
--
   net/sched/sch_red.c: note: in included file:
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int
--
   net/sched/sch_netem.c: note: in included file:
   include/net/inet_ecn.h:97:21: sparse: sparse: restricted __be16 degrades to 
integer
   include/net/inet_ecn.h:97:37: sparse: sparse: restricted __be16 degrades to 
integer
>> include/net/inet_ecn.h:97:19: sparse: sparse: incorrect type in assignment 
>> (different base types) @@     expected restricted __be16 [usertype] 
>> check_add @@     got int @@
   include/net/inet_ecn.h:97:19: sparse:     expected restricted __be16 
[usertype] check_add
   include/net/inet_ecn.h:97:19: sparse:     got int

vim +97 include/net/inet_ecn.h

    67  
    68  #define IP6_ECN_flow_init(label) do {           \
    69        (label) &= ~htonl(INET_ECN_MASK << 20);   \
    70      } while (0)
    71  
    72  #define IP6_ECN_flow_xmit(sk, label) do {                               
\
    73          if (INET_ECN_is_capable(inet6_sk(sk)->tclass))                  
\
    74                  (label) |= htonl(INET_ECN_ECT_0 << 20);                 
\
    75      } while (0)
    76  
    77  static inline int IP_ECN_set_ce(struct iphdr *iph)
    78  {
    79          u32 ecn = (iph->tos + 1) & INET_ECN_MASK;
    80          __be16 check_add;
    81  
    82          /*
    83           * After the last operation we have (in binary):
    84           * INET_ECN_NOT_ECT => 01
    85           * INET_ECN_ECT_1   => 10
    86           * INET_ECN_ECT_0   => 11
    87           * INET_ECN_CE      => 00
    88           */
    89          if (!(ecn & 2))
    90                  return !ecn;
    91  
    92          /*
    93           * The following gives us:
    94           * INET_ECN_ECT_1 => check += htons(0xFFFD)
    95           * INET_ECN_ECT_0 => check += htons(0xFFFE)
    96           */
  > 97          check_add = htons(0xFFFB) + htons(ecn);
    98  
    99          iph->check = csum16_add(iph->check, check_add);
   100          iph->tos |= INET_ECN_CE;
   101          return 1;
   102  }
   103  

---
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