[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 14/20] rbtree: coding style adjustments



Set comment and indentation style to be consistent with linux coding style
and the rest of the file, as suggested by Peter Zijlstra

Signed-off-by: Michel Lespinasse <walken@xxxxxxxxxx>
Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx>
Acked-by: David Woodhouse <David.Woodhouse@xxxxxxxxx>
Cc: Rik van Riel <riel@xxxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Daniel Santos <daniel.santos@xxxxxxxxx>
Cc: Jens Axboe <axboe@xxxxxxxxx>
Cc: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
[Linux commit 7ce6ff9e5de99e7b72019c7de82fb438fe1dc5a0]

Ported to Xen.

Signed-off-by: Praveen Kumar <kpraveen.lkml@xxxxxxxxx>
---
 xen/common/rbtree.c | 44 ++++++++++++++++++++++++--------------------
 1 file changed, 24 insertions(+), 20 deletions(-)

diff --git a/xen/common/rbtree.c b/xen/common/rbtree.c
index 1fe059a568..1cbe9a53d7 100644
--- a/xen/common/rbtree.c
+++ b/xen/common/rbtree.c
@@ -367,16 +367,14 @@ void rb_erase(struct rb_node *node, struct rb_root *root)
         child = node->rb_right;
     else if (!node->rb_right)
         child = node->rb_left;
-    else
-    {
+    else {
         struct rb_node *old = node, *left;
 
         node = node->rb_right;
         while ((left = node->rb_left) != NULL)
             node = left;
 
-        if (rb_parent(old))
-        {
+        if (rb_parent(old)) {
             if (rb_parent(old)->rb_left == old)
                 rb_parent(old)->rb_left = node;
             else
@@ -412,14 +410,12 @@ void rb_erase(struct rb_node *node, struct rb_root *root)
 
     if (child)
         rb_set_parent(child, parent);
-    if (parent)
-    {
+    if (parent) {
         if (parent->rb_left == node)
             parent->rb_left = child;
         else
             parent->rb_right = child;
-    }
-    else
+    } else
         root->rb_node = child;
 
  color:
@@ -464,8 +460,10 @@ struct rb_node *rb_next(const struct rb_node *node)
     if (RB_EMPTY_NODE(node))
         return NULL;
 
-    /* If we have a right-hand child, go down and then left as far
-       as we can. */
+    /*
+     * If we have a right-hand child, go down and then left as far
+     * as we can.
+     */
     if (node->rb_right) {
         node = node->rb_right; 
         while (node->rb_left)
@@ -473,12 +471,14 @@ struct rb_node *rb_next(const struct rb_node *node)
         return (struct rb_node *)node;
     }
 
-    /* No right-hand children.  Everything down and left is
-       smaller than us, so any 'next' node must be in the general
-       direction of our parent. Go up the tree; any time the
-       ancestor is a right-hand child of its parent, keep going
-       up. First time it's a left-hand child of its parent, said
-       parent is our 'next' node. */
+    /*
+     * No right-hand children.  Everything down and left is
+     * smaller than us, so any 'next' node must be in the general
+     * direction of our parent. Go up the tree; any time the
+     * ancestor is a right-hand child of its parent, keep going
+     * up. First time it's a left-hand child of its parent, said
+     * parent is our 'next' node.
+     */
     while ((parent = rb_parent(node)) && node == parent->rb_right)
         node = parent;
 
@@ -493,8 +493,10 @@ struct rb_node *rb_prev(const struct rb_node *node)
     if (RB_EMPTY_NODE(node))
         return NULL;
 
-    /* If we have a left-hand child, go down and then right as far
-       as we can. */
+    /*
+     * If we have a left-hand child, go down and then right as far
+     * as we can.
+     */
     if (node->rb_left) {
         node = node->rb_left; 
         while (node->rb_right)
@@ -502,8 +504,10 @@ struct rb_node *rb_prev(const struct rb_node *node)
         return (struct rb_node *)node;
     }
 
-    /* No left-hand children. Go up till we find an ancestor which
-       is a right-hand child of its parent */
+    /*
+     * No left-hand children. Go up till we find an ancestor which
+     * is a right-hand child of its parent
+     */
     while ((parent = rb_parent(node)) && node == parent->rb_left)
         node = parent;
 
-- 
2.12.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.