Re: [RFT] fib_trie: cleanup
From: Andrew Morton <akpm@linux-foundation.org>
Date: 2007-07-26 09:05:41
On Thu, 26 Jul 2007 09:46:48 +0100 Stephen Hemminger [off-list ref] wrote:
Try this out:
* replace macro's with inlines
* get rid of places doing multiple evaluations of NODE_PARENTAnd it fixes the rcu abuse which resulted in http://lkml.org/lkml/2007/7/25/319. Which I assume is what inspired the effort. your typecasting style is inconsistent:
+ return rcu_dereference((struct tnode *) (node->parent & ~NODE_TYPE_MASK));
space
+ (unsigned long)ptr | NODE_TYPE(node));
no space
+ while (tn != NULL && (tp = node_parent((struct node *)tn)) != NULL) {no space
+ tp = node_parent((struct node *) tn);
space
+ node_set_parent((struct node *)l, tp);
no space
+ node_set_parent((struct node *)tn, tp);
no space
+ struct tnode *parent = node_parent((struct node *) pn);
space etc. "no space" seems to be more usual, by about a 50.1:49.9 ratio. It is a lot more common in net/: box:/usr/src/25> grep '[(]unsigned long[)] ' net/*/*.c | wc -l 91 box:/usr/src/25> grep '[(]unsigned long[)][^ ]' net/*/*.c | wc -l 242