Patchwork UBIFS: remove unnecessary code in ubifs_garbage_collect

login
register
mail settings
Submitter wang.bo116@zte.com.cn
Date Aug. 15, 2013, 10:54 a.m.
Message ID <OF5D2B97A5.BBB53CFB-ON48257BC8.00312DE8-48257BC8.003BEE50@zte.com.cn>
Download mbox | patch
Permalink /patch/267350/
State New
Headers show

Comments

wang.bo116@zte.com.cn - Aug. 15, 2013, 10:54 a.m.
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>
 		cond_resched();
Ezequiel Garcia - Aug. 15, 2013, 9:15 p.m.
Hi,

First of all: thanks for contributing!

On Thu, Aug 15, 2013 at 06:54:26PM +0800, wang.bo116@zte.com.cn wrote:
> 
> Hi,
> 	In ubifs_garbage_collect, "space_before" calculate twice, i think the
> first one is unnecessary.
> 

Mmm... this is not the way patches are contributed, although you were
close.

Please read: Documentation/SubmittingPatches and maybe see this video
as well:

http://www.youtube.com/watch?v=XXix80GCvpo

Thanks!

> 
> 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();
> 
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

Patch

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;