bonding: Use RCU_INIT_POINTER() for better overhead and for sparse
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 9 Dec 2013 23:19:53 +0000 (15:19 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 12 Dec 2013 20:19:17 +0000 (12:19 -0800)
Although rcu_assign_pointer() can be used to assign a constant
NULL pointer, doing so gets you an unnecessary memory barrier and
in some circumstances, sparse warnings.  This commit therefore
changes the rcu_assign_pointer() of NULL in __bond_release_one() to
RCU_INIT_POINTER().

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
drivers/net/bonding/bond_main.c

index 4dd5ee2..a0b97c4 100644 (file)
@@ -1763,7 +1763,7 @@ static int __bond_release_one(struct net_device *bond_dev,
        }
 
        if (all) {
-               rcu_assign_pointer(bond->curr_active_slave, NULL);
+               RCU_INIT_POINTER(bond->curr_active_slave, NULL);
        } else if (oldcurrent == slave) {
                /*
                 * Note that we hold RTNL over this sequence, so there