fs-ext3-use-rbtree-postorder-iteration-helper-instead-of-opencoding-fix
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 23 Jan 2014 23:56:13 +0000 (15:56 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Jan 2014 00:37:03 +0000 (16:37 -0800)
use do{}while - more efficient and it squishes a coccinelle warning

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: Cody P Schafer <cody@linux.vnet.ibm.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Michel Lespinasse <walken@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ext3/dir.c

index a331ad1c23f818469d3a2aaf7657791c97461413..e66e4808719f1958cec123853cd7224ee103d479 100644 (file)
@@ -312,11 +312,11 @@ static void free_rb_tree_fname(struct rb_root *root)
        struct fname *fname, *next;
 
        rbtree_postorder_for_each_entry_safe(fname, next, root, rb_hash)
-               while (fname) {
-                       struct fname * old = fname;
+               do {
+                       struct fname *old = fname;
                        fname = fname->next;
-                       kfree (old);
-               }
+                       kfree(old);
+               } while (fname);
 
        *root = RB_ROOT;
 }