Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ea7415cca922389b4f3c0cf75e0af9fbf827880e
Commit:     ea7415cca922389b4f3c0cf75e0af9fbf827880e
Parent:     29175778b07aa60e7f8030bd95d69f70070cc1f7
Author:     Akinobu Mita <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 20 14:41:05 2006 -0700
Committer:  David Woodhouse <[EMAIL PROTECTED]>
CommitDate: Sat Oct 21 16:21:40 2006 +0100

    [JFFS2] Use rb_first() and rb_last() cleanup
    
    Use rb_first() and rb_last() to implement frag_first() and frag_last().
    
    Signed-off-by: Akinbou Mita <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
---
 fs/jffs2/nodelist.h |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/fs/jffs2/nodelist.h b/fs/jffs2/nodelist.h
index 0ddfd70..4178b4b 100644
--- a/fs/jffs2/nodelist.h
+++ b/fs/jffs2/nodelist.h
@@ -294,23 +294,21 @@ static inline int jffs2_encode_dev(union 
jffs2_device_node *jdev, dev_t rdev)
 
 static inline struct jffs2_node_frag *frag_first(struct rb_root *root)
 {
-       struct rb_node *node = root->rb_node;
+       struct rb_node *node = rb_first(root);
 
        if (!node)
                return NULL;
-       while(node->rb_left)
-               node = node->rb_left;
+
        return rb_entry(node, struct jffs2_node_frag, rb);
 }
 
 static inline struct jffs2_node_frag *frag_last(struct rb_root *root)
 {
-       struct rb_node *node = root->rb_node;
+       struct rb_node *node = rb_last(root);
 
        if (!node)
                return NULL;
-       while(node->rb_right)
-               node = node->rb_right;
+
        return rb_entry(node, struct jffs2_node_frag, rb);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to