From: Andrew Morton Date: Fri, 3 Jan 2014 03:10:34 +0000 (+1100) Subject: fs-ext3-use-rbtree-postorder-iteration-helper-instead-of-opencoding-fix X-Git-Tag: next-20140106~2^2~13 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=42bb649d97772ea76652460d7e40c5cf08db3a06;p=karo-tx-linux.git fs-ext3-use-rbtree-postorder-iteration-helper-instead-of-opencoding-fix use do{}while - more efficient and it squishes a coccinelle warning Reported-by: Fengguang Wu Cc: Cody P Schafer Cc: Jan Kara Cc: Michel Lespinasse Signed-off-by: Andrew Morton --- diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c index a331ad1c23f8..e66e4808719f 100644 --- a/fs/ext3/dir.c +++ b/fs/ext3/dir.c @@ -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; }