diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-08-01 12:19:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-02 07:29:23 -0400 |
commit | a9b3cd7f323b2e57593e7215362a7b02fc933e3a (patch) | |
tree | eba1741956aef3015d5b1a07253bf93c4c1bc7df /net/ipv4/gre.c | |
parent | 76f793e3a47139d340185cbc1a314740c09b13d3 (diff) |
rcu: convert uses of rcu_assign_pointer(x, NULL) to RCU_INIT_POINTER
When assigning a NULL value to an RCU protected pointer, no barrier
is needed. The rcu_assign_pointer, used to handle that but will soon
change to not handle the special case.
Convert all rcu_assign_pointer of NULL value.
//smpl
@@ expression P; @@
- rcu_assign_pointer(P, NULL)
+ RCU_INIT_POINTER(P, NULL)
// </smpl>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/gre.c')
-rw-r--r-- | net/ipv4/gre.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/gre.c b/net/ipv4/gre.c index dbfc21de3479..8cb1ebb7cd74 100644 --- a/net/ipv4/gre.c +++ b/net/ipv4/gre.c | |||
@@ -34,7 +34,7 @@ int gre_add_protocol(const struct gre_protocol *proto, u8 version) | |||
34 | if (gre_proto[version]) | 34 | if (gre_proto[version]) |
35 | goto err_out_unlock; | 35 | goto err_out_unlock; |
36 | 36 | ||
37 | rcu_assign_pointer(gre_proto[version], proto); | 37 | RCU_INIT_POINTER(gre_proto[version], proto); |
38 | spin_unlock(&gre_proto_lock); | 38 | spin_unlock(&gre_proto_lock); |
39 | return 0; | 39 | return 0; |
40 | 40 | ||
@@ -54,7 +54,7 @@ int gre_del_protocol(const struct gre_protocol *proto, u8 version) | |||
54 | if (rcu_dereference_protected(gre_proto[version], | 54 | if (rcu_dereference_protected(gre_proto[version], |
55 | lockdep_is_held(&gre_proto_lock)) != proto) | 55 | lockdep_is_held(&gre_proto_lock)) != proto) |
56 | goto err_out_unlock; | 56 | goto err_out_unlock; |
57 | rcu_assign_pointer(gre_proto[version], NULL); | 57 | RCU_INIT_POINTER(gre_proto[version], NULL); |
58 | spin_unlock(&gre_proto_lock); | 58 | spin_unlock(&gre_proto_lock); |
59 | synchronize_rcu(); | 59 | synchronize_rcu(); |
60 | return 0; | 60 | return 0; |