From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753818AbbC0Jtz (ORCPT ); Fri, 27 Mar 2015 05:49:55 -0400 Received: from e34.co.us.ibm.com ([32.97.110.152]:36507 "EHLO e34.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752724AbbC0Jtw (ORCPT ); Fri, 27 Mar 2015 05:49:52 -0400 Date: Fri, 27 Mar 2015 02:49:43 -0700 From: "Paul E. McKenney" To: Ying Xue Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] rculist: Fix another sparse warning Message-ID: <20150327094943.GP28980@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <1427347628-9514-1-git-send-email-ying.xue@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1427347628-9514-1-git-send-email-ying.xue@windriver.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15032709-0017-0000-0000-000009AD79BB Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 26, 2015 at 01:27:08PM +0800, Ying Xue wrote: > This fixes the following sparse warnings: > > make C=1 CF=-D__CHECK_ENDIAN__ net/tipc/name_table.o > net/tipc/name_table.c:977:17: error: incompatible types in comparison expression (different address spaces) > net/tipc/name_table.c:977:17: error: incompatible types in comparison expression (different address spaces) > > To silence these spare complaints, an RCU annotation should be added to > "next" pointer of hlist_node structure through hlist_next_rcu() macro > when iterating over a hlist with hlist_for_each_entry_from_rcu(). > > Signed-off-by: Ying Xue Queued for testing, thank you! If testing goes well, I will push it into the 4.3 merge window. Thanx, Paul > --- > Changes: > - Replace rcu_dereference_bh() with rcu_dereference_raw() suggested > by Paul. > > include/linux/rculist.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/rculist.h b/include/linux/rculist.h > index a18b16f..fd1c870 100644 > --- a/include/linux/rculist.h > +++ b/include/linux/rculist.h > @@ -549,8 +549,8 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n, > */ > #define hlist_for_each_entry_from_rcu(pos, member) \ > for (; pos; \ > - pos = hlist_entry_safe(rcu_dereference((pos)->member.next),\ > - typeof(*(pos)), member)) > + pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu( \ > + &(pos)->member)), typeof(*(pos)), member)) > > #endif /* __KERNEL__ */ > #endif > -- > 1.7.9.5 >