Thread (38 messages) 38 messages, 4 authors, 2012-08-07

Re: [PATCH v2 9/9] rbtree: remove prior augmented rbtree implementation

From: Joe Perches <joe@perches.com>
Date: 2012-08-02 22:41:20
Also in: lkml

On Thu, 2012-08-02 at 15:34 -0700, Michel Lespinasse wrote:
convert arch/x86/mm/pat_rbtree.c to the proposed augmented rbtree api
and remove the old augmented rbtree implementation.
style trivia:
+static u64 compute_subtree_max_end(struct memtype *data)
 {
-	struct memtype *data;
-	u64 max_end, child_max_end;
-
-	if (!node)
-		return;
-
-	data = container_of(node, struct memtype, rb);
-	max_end = data->end;
+	u64 max_end = data->end, child_max_end;
 
-	child_max_end = get_subtree_max_end(node->rb_right);
+	child_max_end = get_subtree_max_end(data->rb.rb_right);
I think this reads better as:

	u64 max_end = data->end;
	u64 child_max_end = get_subtree_max_end(node->rb.rb_right);


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help