fs-ext3-use-rbtree-postorder-iteration-helper-instead-of-opencoding-fix

Author: Andrew Morton <akpm@linux-foundation.org>

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 
Signed-off-by: Linus Torvalds 
---
 fs/ext3/dir.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
 
diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c
index a331ad1..e66e480 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;
 }
BtrLinux
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.