public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] UBIFS: remove unnecessary code in ubifs_garbage_collect
@ 2013-08-16  7:43 wang.bo116
  2013-09-17  1:51 ` Brian Norris
  0 siblings, 1 reply; 6+ messages in thread
From: wang.bo116 @ 2013-08-16  7:43 UTC (permalink / raw)
  To: linux-mtd



Hi,
	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 <wang.bo116@zte.com.cn>
diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c
index 76ca53c..38dc67d 100755
--- a/fs/ubifs/gc.c
+++ b/fs/ubifs/gc.c
@@ -668,7 +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_before;
 		int space_after;

 		cond_resched();

^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH] UBIFS: remove unnecessary code in ubifs_garbage_collect
@ 2013-08-15 10:54 wang.bo116
  2013-08-15 21:15 ` Ezequiel Garcia
  0 siblings, 1 reply; 6+ messages in thread
From: wang.bo116 @ 2013-08-15 10:54 UTC (permalink / raw)
  To: linux-mtd; +Cc: artem.bityutskiy


Hi,
	In ubifs_garbage_collect, "space_before" calculate twice, i think the
first one is unnecessary.


Signed-off-by: wang bo <wang.bo116@zte.com.cn>
diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c
index 76ca53c..38dc67d 100755
--- a/fs/ubifs/gc.c
+++ b/fs/ubifs/gc.c
@@ -668,7 +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_before;
 		int space_after;

 		cond_resched();

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-10-22 14:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-16  7:43 [PATCH] UBIFS: remove unnecessary code in ubifs_garbage_collect wang.bo116
2013-09-17  1:51 ` Brian Norris
2013-10-19 13:27   ` Ezequiel Garcia
2013-10-22 14:44     ` Artem Bityutskiy
  -- strict thread matches above, loose matches on Subject: below --
2013-08-15 10:54 wang.bo116
2013-08-15 21:15 ` Ezequiel Garcia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox