public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Ying Xue <ying.xue@windriver.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] rculist: Fix another sparse warning
Date: Fri, 27 Mar 2015 02:49:43 -0700	[thread overview]
Message-ID: <20150327094943.GP28980@linux.vnet.ibm.com> (raw)
In-Reply-To: <1427347628-9514-1-git-send-email-ying.xue@windriver.com>

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 <ying.xue@windriver.com>

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
> 


      reply	other threads:[~2015-03-27  9:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26  5:27 [PATCH v2] rculist: Fix another sparse warning Ying Xue
2015-03-27  9:49 ` Paul E. McKenney [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150327094943.GP28980@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ying.xue@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox