From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751859Ab3LKXJR (ORCPT ); Wed, 11 Dec 2013 18:09:17 -0500 Received: from e37.co.us.ibm.com ([32.97.110.158]:40262 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751669Ab3LKXI5 (ORCPT ); Wed, 11 Dec 2013 18:08:57 -0500 From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: mingo@kernel.org, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, darren@dvhart.com, fweisbec@gmail.com, oleg@redhat.com, sbw@mit.edu, "Paul E. McKenney" Subject: [PATCH v2 tip/core/rcu 2/4] bonding: Use RCU_INIT_POINTER() for better overhead and for sparse Date: Wed, 11 Dec 2013 15:08:46 -0800 Message-Id: <1386803328-13272-2-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1386803328-13272-1-git-send-email-paulmck@linux.vnet.ibm.com> References: <20131211230823.GA12448@linux.vnet.ibm.com> <1386803328-13272-1-git-send-email-paulmck@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13121123-7164-0000-0000-0000042705C4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Paul E. McKenney" 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 --- drivers/net/bonding/bond_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 4dd5ee2a34cc..a0b97c4c655d 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -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 -- 1.8.1.5