• David S. Miller's avatar
    net: sched: Fix warnings from xchg() on RCU'd cookie pointer. · 0dbc81ea
    David S. Miller authored
    The kbuild test robot reports:
    
    >> net/sched/act_api.c:71:15: sparse: incorrect type in initializer (different address spaces) @@    expected struct tc_cookie [noderef] <asn:4>*__ret @@    got [noderef] <asn:4>*__ret @@
       net/sched/act_api.c:71:15:    expected struct tc_cookie [noderef] <asn:4>*__ret
       net/sched/act_api.c:71:15:    got struct tc_cookie *new_cookie
    >> net/sched/act_api.c:71:13: sparse: incorrect type in assignment (different address spaces) @@    expected struct tc_cookie *old @@    got struct tc_cookie [noderef] <struct tc_cookie *old @@
       net/sched/act_api.c:71:13:    expected struct tc_cookie *old
       net/sched/act_api.c:71:13:    got struct tc_cookie [noderef] <asn:4>*[assigned] __ret
    >> net/sched/act_api.c:132:48: sparse: dereference of noderef expression
    
    Handle this in the usual way by force casting away the __rcu annotation
    when we are using xchg() on it.
    
    Fixes: eec94fdb ("net: sched: use rcu for action cookie update")
    Reported-by: default avatarkbuild test robot <lkp@intel.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    0dbc81ea
act_api.c 40.2 KB