Skip to content

Commit

Permalink
[IPV4] fib_trie: fix warning from rcu_assign_poinger
Browse files Browse the repository at this point in the history
This gets rid of a warning caused by the test in rcu_assign_pointer.
I tried to fix rcu_assign_pointer, but that devolved into a long set
of discussions about doing it right that came to no real solution.
Since the test in rcu_assign_pointer for constant NULL would never
succeed in fib_trie, just open code instead.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and davem330 committed Mar 23, 2008
1 parent 69d1506 commit 6440cc9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,13 @@ static inline struct tnode *node_parent_rcu(struct node *node)
return rcu_dereference(ret);
}

/* Same as rcu_assign_pointer
* but that macro() assumes that value is a pointer.
*/
static inline void node_set_parent(struct node *node, struct tnode *ptr)
{
rcu_assign_pointer(node->parent,
(unsigned long)ptr | NODE_TYPE(node));
smp_wmb();
node->parent = (unsigned long)ptr | NODE_TYPE(node);
}

static inline struct node *tnode_get_child(struct tnode *tn, unsigned int i)
Expand Down

0 comments on commit 6440cc9

Please sign in to comment.