From: Yajun Deng Date: Sat, 18 Sep 2021 06:36:07 +0000 (+0800) Subject: net: rtnetlink: convert rcu_assign_pointer to RCU_INIT_POINTER X-Git-Tag: v6.1-rc5~2768^2~408 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4fc29989835ab7379f807854b5f7338b752b9f1a;p=platform%2Fkernel%2Flinux-starfive.git net: rtnetlink: convert rcu_assign_pointer to RCU_INIT_POINTER It no need barrier when assigning a NULL value to an RCU protected pointer. So use RCU_INIT_POINTER() instead for more fast. Signed-off-by: Yajun Deng Signed-off-by: David S. Miller --- diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 972c8cb..327ca6b 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -301,7 +301,7 @@ int rtnl_unregister(int protocol, int msgtype) } link = rtnl_dereference(tab[msgindex]); - rcu_assign_pointer(tab[msgindex], NULL); + RCU_INIT_POINTER(tab[msgindex], NULL); rtnl_unlock(); kfree_rcu(link, rcu); @@ -337,7 +337,7 @@ void rtnl_unregister_all(int protocol) if (!link) continue; - rcu_assign_pointer(tab[msgindex], NULL); + RCU_INIT_POINTER(tab[msgindex], NULL); kfree_rcu(link, rcu); } rtnl_unlock();