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

From: Joe Perches
Date: Thu Aug 02 2012 - 18:41:13 EST


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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/