Skip to content
  • Marc Kleine-Budde's avatar
    can: af_can: do not access proto_tab directly use rcu_access_pointer instead · cae1d5b7
    Marc Kleine-Budde authored
    
    
    "proto_tab" is a RCU protected array, when directly accessing the array,
    sparse throws these warnings:
    
      CHECK   /srv/work/frogger/socketcan/linux/net/can/af_can.c
    net/can/af_can.c:115:14: error: incompatible types in comparison expression (different address spaces)
    net/can/af_can.c:795:17: error: incompatible types in comparison expression (different address spaces)
    net/can/af_can.c:816:9: error: incompatible types in comparison expression (different address spaces)
    
    This patch fixes the problem by using rcu_access_pointer() and
    annotating "proto_tab" array as __rcu.
    
    Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
    cae1d5b7