netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>,
	Adrian Bunk <bunk@stusta.de>,
	Robert Olsson <Robert.Olsson@data.slu.se>,
	Ingo Molnar <mingo@elte.hu>, Josh Triplett <josh@kernel.org>,
	netdev@vger.kernel.org
Subject: Re: [RFC] fib_trie: whitespace cleanup
Date: Mon, 30 Jul 2007 10:07:34 -0700	[thread overview]
Message-ID: <20070730170734.GB11257@linux.vnet.ibm.com> (raw)
In-Reply-To: <20070726215630.96f971d4.akpm@linux-foundation.org>

On Thu, Jul 26, 2007 at 09:56:30PM -0700, Andrew Morton wrote:
> On Thu, 26 Jul 2007 08:44:21 -0700 "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:
> 
> > On Thu, Jul 26, 2007 at 11:49:42AM +0100, Stephen Hemminger wrote:
> > > Whitespace cleanup run code through lindent then cleanup results.
> > > Applys after other two patches.
> > > 
> > > --- a/net/ipv4/fib_trie.c	2007-07-26 10:17:21.000000000 +0100
> > > +++ b/net/ipv4/fib_trie.c	2007-07-26 11:47:52.000000000 +0100
> > > @@ -156,7 +156,8 @@ struct trie {
> > >  };
> > > 
> > >  static void put_child(struct trie *t, struct tnode *tn, int i, struct node *n);
> > > -static void tnode_put_child_reorg(struct tnode *tn, int i, struct node *n, int wasfull);
> > > +static void tnode_put_child_reorg(struct tnode *tn, int i, struct node *n,
> > > +				  int wasfull);
> > >  static struct node *resize(struct trie *t, struct tnode *tn);
> > >  static struct tnode *inflate(struct trie *t, struct tnode *tn);
> > >  static struct tnode *halve(struct trie *t, struct tnode *tn);
> > > @@ -167,13 +168,12 @@ static struct trie *trie_local = NULL, *
> > > 
> > >  static inline struct tnode *node_parent(struct node *node)
> > >  {
> > > -	return rcu_dereference((struct tnode *) (node->parent & ~NODE_TYPE_MASK));
> > > +	return rcu_dereference((struct tnode *)(node->parent & ~NODE_TYPE_MASK));
> > 
> > The potential issue is applying rcu_dereference() to an rvalue
> > as opposed to an lvalue.  So how about the following?
> > 
> 
> I did this:
> 
> static inline struct tnode *node_parent(struct node *node)
> {
> 	struct tnode *ret;
> 
> 	ret = (struct tnode *)(node->parent & ~NODE_TYPE_MASK);
> 	return rcu_dereference(ret);
> }

I would feel more comfortable with the rcu_dereference() covering the
initial fetch from node->parent, but do not have any hard objections
to your approach.

						Thanx, Paul

  reply	other threads:[~2007-07-30 17:07 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070725040304.111550f4.akpm@linux-foundation.org>
2007-07-25 13:36 ` [-mm patch] one e1000 driver should be enough for everyone Adrian Bunk
2007-07-25 13:48   ` Jeff Garzik
2007-07-25 14:46     ` Adrian Bunk
2007-07-25 15:05       ` Jeff Garzik
2007-07-25 15:21         ` Kok, Auke
2007-07-25 15:23           ` Jeff Garzik
2007-07-25 20:50           ` Andrew Morton
2007-07-25 18:15 ` 2.6.23-rc1-mm1: net/ipv4/fib_trie.c compile error Adrian Bunk
2007-07-26  8:46   ` [RFT] fib_trie: cleanup Stephen Hemminger
2007-07-26  8:49     ` David Miller
2007-07-26 10:32       ` Robert Olsson
2007-07-26  9:04     ` Andrew Morton
2007-07-26  9:15       ` Stephen Hemminger
2007-07-26 10:49       ` [RFC] fib_trie: whitespace cleanup Stephen Hemminger
2007-07-26 15:44         ` Paul E. McKenney
2007-07-27  4:56           ` Andrew Morton
2007-07-30 17:07             ` Paul E. McKenney [this message]
2007-07-26 10:43     ` [RFT] fib_trie: macro cleanup Stephen Hemminger
2007-07-26 10:54       ` Andrew Morton
2007-07-28 15:44 ` NETPOLL=y , NETDEVICES=n compile error ( Re: 2.6.23-rc1-mm1 ) Gabriel C
2007-07-28 17:26   ` Andrew Morton
2007-07-28 18:42     ` Gabriel C
2007-07-31  8:32       ` Jarek Poplawski
2007-07-31 10:14         ` Gabriel C
2007-07-31 11:44           ` Jason Wessel
2007-07-31 12:47             ` Jarek Poplawski
2007-07-31 12:17           ` Jarek Poplawski
2007-07-31 15:05             ` Gabriel C
2007-08-01  9:59               ` Jarek Poplawski
2007-08-02  2:02                 ` Matt Mackall
2007-08-02  9:00                   ` Jarek Poplawski
2007-08-02 15:59                     ` Matt Mackall
2007-08-03  7:30                       ` Jarek Poplawski
2007-08-02  9:36                   ` Sam Ravnborg
2007-08-02 10:32                     ` Satyam Sharma
2007-08-02 11:40                       ` Satyam Sharma
2007-08-02 11:40                       ` Jarek Poplawski
2007-08-02 11:56                         ` Satyam Sharma
2007-08-02 12:52                           ` Jarek Poplawski
2007-08-06 11:51                     ` [PATCH] docs: note about select in kconfig-language.txt Jarek Poplawski

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=20070730170734.GB11257@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=Robert.Olsson@data.slu.se \
    --cc=akpm@linux-foundation.org \
    --cc=bunk@stusta.de \
    --cc=josh@kernel.org \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).