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/802 | |
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/802')
-rw-r--r-- | net/802/garp.c | 4 | ||||
-rw-r--r-- | net/802/stp.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/net/802/garp.c b/net/802/garp.c index 16102951d36a..070bf4403bf8 100644 --- a/net/802/garp.c +++ b/net/802/garp.c | |||
@@ -553,7 +553,7 @@ static void garp_release_port(struct net_device *dev) | |||
553 | if (rtnl_dereference(port->applicants[i])) | 553 | if (rtnl_dereference(port->applicants[i])) |
554 | return; | 554 | return; |
555 | } | 555 | } |
556 | rcu_assign_pointer(dev->garp_port, NULL); | 556 | RCU_INIT_POINTER(dev->garp_port, NULL); |
557 | kfree_rcu(port, rcu); | 557 | kfree_rcu(port, rcu); |
558 | } | 558 | } |
559 | 559 | ||
@@ -605,7 +605,7 @@ void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl | |||
605 | 605 | ||
606 | ASSERT_RTNL(); | 606 | ASSERT_RTNL(); |
607 | 607 | ||
608 | rcu_assign_pointer(port->applicants[appl->type], NULL); | 608 | RCU_INIT_POINTER(port->applicants[appl->type], NULL); |
609 | 609 | ||
610 | /* Delete timer and generate a final TRANSMIT_PDU event to flush out | 610 | /* Delete timer and generate a final TRANSMIT_PDU event to flush out |
611 | * all pending messages before the applicant is gone. */ | 611 | * all pending messages before the applicant is gone. */ |
diff --git a/net/802/stp.c b/net/802/stp.c index 978c30b1b36b..0e136ef1e4ba 100644 --- a/net/802/stp.c +++ b/net/802/stp.c | |||
@@ -88,9 +88,9 @@ void stp_proto_unregister(const struct stp_proto *proto) | |||
88 | { | 88 | { |
89 | mutex_lock(&stp_proto_mutex); | 89 | mutex_lock(&stp_proto_mutex); |
90 | if (is_zero_ether_addr(proto->group_address)) | 90 | if (is_zero_ether_addr(proto->group_address)) |
91 | rcu_assign_pointer(stp_proto, NULL); | 91 | RCU_INIT_POINTER(stp_proto, NULL); |
92 | else | 92 | else |
93 | rcu_assign_pointer(garp_protos[proto->group_address[5] - | 93 | RCU_INIT_POINTER(garp_protos[proto->group_address[5] - |
94 | GARP_ADDR_MIN], NULL); | 94 | GARP_ADDR_MIN], NULL); |
95 | synchronize_rcu(); | 95 | synchronize_rcu(); |
96 | 96 | ||