Skip to content

Commit

Permalink
fs-ext3-use-rbtree-postorder-iteration-helper-instead-of-opencoding-fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Jan 24, 2014
1 parent b1c8047 commit ed8f686
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/ext3/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ed8f686

Please sign in to comment.