From e71d1a59e757201454fd3cf66ddaceaf961bfb41 Mon Sep 17 00:00:00 2001 From: "wang.bo116@zte.com.cn" Date: Fri, 16 Aug 2013 15:43:36 +0800 Subject: [PATCH] UBIFS: remove unnecessary code in ubifs_garbage_collect In ubifs_garbage_collect,local variable "space_before" calculate twice. In fact, at the beginning of the loop, there is no need to calculate this variable. Calculate it before call "ubifs_garbage_collect_leb" is enough. This patch just remove the unnecessary calculate code. Signed-off-by: wang bo Acked-by: Brian Norris Signed-off-by: Artem Bityutskiy --- fs/ubifs/gc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c index 76ca53cd3eee..9718da86ad01 100644 --- a/fs/ubifs/gc.c +++ b/fs/ubifs/gc.c @@ -668,8 +668,7 @@ int ubifs_garbage_collect(struct ubifs_info *c, int anyway) ubifs_assert(!wbuf->used); for (i = 0; ; i++) { - int space_before = c->leb_size - wbuf->offs - wbuf->used; - int space_after; + int space_before, space_after; cond_resched(); -- 2.39.2