public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] fs: cleanup for fs/jffs2/compr_rubin.c
@ 2008-12-06 13:18 Jianjun Kong
  0 siblings, 0 replies; 4+ messages in thread
From: Jianjun Kong @ 2008-12-06 13:18 UTC (permalink / raw)
  To: linux-mtd; +Cc: David Howells, dwmw2


fs/jffs2/compr_rubin.c:
remove duplicated #include and other cleanup

Signed-off-by: Jianjun Kong <jianjun@zeuux.org>
---
 fs/jffs2/compr_rubin.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/fs/jffs2/compr_rubin.c b/fs/jffs2/compr_rubin.c
index c73fa89..cb02050 100644
--- a/fs/jffs2/compr_rubin.c
+++ b/fs/jffs2/compr_rubin.c
@@ -24,8 +24,6 @@
 #define BIT_DIVIDER_MIPS 1043
 static int bits_mips[8] = { 277,249,290,267,229,341,212,241}; /* mips32 */
 
-#include <linux/errno.h>
-
 struct pushpull {
 	unsigned char *buf;
 	unsigned int buflen;
@@ -157,7 +155,8 @@ static void init_decode(struct rubin_state *rs, int div, int *bits)
 	/* behalve lower */
 	rs->rec_q = 0;
 
-	for (rs->bit_number = 0; rs->bit_number++ < RUBIN_REG_SIZE; rs->rec_q = rs->rec_q * 2 + (long) (pullbit(&rs->pp)))
+	for (rs->bit_number = 0; rs->bit_number++ < RUBIN_REG_SIZE;
+		rs->rec_q = rs->rec_q * 2 + (long) (pullbit(&rs->pp)))
 		;
 }
 
@@ -234,14 +233,14 @@ static int out_byte(struct rubin_state *rs, unsigned char byte)
 	struct rubin_state rs_copy;
 	rs_copy = *rs;
 
-	for (i=0;i<8;i++) {
-		ret = encode(rs, rs->bit_divider-rs->bits[i],rs->bits[i],byte&1);
+	for (i=0; i<8; i++) {
+		ret = encode(rs, rs->bit_divider-rs->bits[i], rs->bits[i], byte&1);
 		if (ret) {
 			/* Failed. Restore old state */
 			*rs = rs_copy;
 			return ret;
 		}
-		byte=byte>>1;
+		byte >>= 1;
 	}
 	return 0;
 }
-- 
1.5.6.3

-- 
Jianjun Kong | Happy Hacking
HOMEPAGE: http://kongove.cn/
GTALK: kongjianjun@gmail.com

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

* [PATCH] fs: cleanup for fs/jffs2/compr_rubin.c
@ 2008-12-08 15:05 Jianjun Kong
  2008-12-08 15:39 ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Jianjun Kong @ 2008-12-08 15:05 UTC (permalink / raw)
  To: David.Woodhouse; +Cc: linux-mtd


fs: cleanup for fs/jffs2/compr_rubin.c

fs/jffs2/compr_rubin.c:
remove duplicated #include and other cleanup

Signed-off-by: Jianjun Kong <jianjun@zeuux.org>
---
 fs/jffs2/compr_rubin.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/fs/jffs2/compr_rubin.c b/fs/jffs2/compr_rubin.c
index c73fa89..cb02050 100644
--- a/fs/jffs2/compr_rubin.c
+++ b/fs/jffs2/compr_rubin.c
@@ -24,8 +24,6 @@
 #define BIT_DIVIDER_MIPS 1043
 static int bits_mips[8] = { 277,249,290,267,229,341,212,241}; /* mips32 */
 
-#include <linux/errno.h>
-
 struct pushpull {
 	unsigned char *buf;
 	unsigned int buflen;
@@ -157,7 +155,8 @@ static void init_decode(struct rubin_state *rs, int div, int *bits)
 	/* behalve lower */
 	rs->rec_q = 0;
 
-	for (rs->bit_number = 0; rs->bit_number++ < RUBIN_REG_SIZE; rs->rec_q = rs->rec_q * 2 + (long) (pullbit(&rs->pp)))
+	for (rs->bit_number = 0; rs->bit_number++ < RUBIN_REG_SIZE;
+		rs->rec_q = rs->rec_q * 2 + (long) (pullbit(&rs->pp)))
 		;
 }
 
@@ -234,14 +233,14 @@ static int out_byte(struct rubin_state *rs, unsigned char byte)
 	struct rubin_state rs_copy;
 	rs_copy = *rs;
 
-	for (i=0;i<8;i++) {
-		ret = encode(rs, rs->bit_divider-rs->bits[i],rs->bits[i],byte&1);
+	for (i=0; i<8; i++) {
+		ret = encode(rs, rs->bit_divider-rs->bits[i], rs->bits[i], byte&1);
 		if (ret) {
 			/* Failed. Restore old state */
 			*rs = rs_copy;
 			return ret;
 		}
-		byte=byte>>1;
+		byte >>= 1;
 	}
 	return 0;
 }
-- 
1.5.6.3

--
Jianjun Kong |Happy Hacking
Homepage: http://kongove.cn
Gtalk:kongjianjun@gmail.com

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

* Re: [PATCH] fs: cleanup for fs/jffs2/compr_rubin.c
  2008-12-08 15:05 Jianjun Kong
@ 2008-12-08 15:39 ` Geert Uytterhoeven
  2008-12-09  0:32   ` Jianjun Kong
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2008-12-08 15:39 UTC (permalink / raw)
  To: Jianjun Kong; +Cc: linux-mtd, David.Woodhouse

On Mon, 8 Dec 2008, Jianjun Kong wrote:
> fs: cleanup for fs/jffs2/compr_rubin.c
> 
> fs/jffs2/compr_rubin.c:
> remove duplicated #include and other cleanup
> 
> Signed-off-by: Jianjun Kong <jianjun@zeuux.org>
> ---
>  fs/jffs2/compr_rubin.c |   11 +++++------
>  1 files changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/jffs2/compr_rubin.c b/fs/jffs2/compr_rubin.c
> index c73fa89..cb02050 100644
> --- a/fs/jffs2/compr_rubin.c
> +++ b/fs/jffs2/compr_rubin.c
> @@ -24,8 +24,6 @@
>  #define BIT_DIVIDER_MIPS 1043
>  static int bits_mips[8] = { 277,249,290,267,229,341,212,241}; /* mips32 */
>  
> -#include <linux/errno.h>
> -
>  struct pushpull {
>  	unsigned char *buf;
>  	unsigned int buflen;
> @@ -157,7 +155,8 @@ static void init_decode(struct rubin_state *rs, int div, int *bits)
>  	/* behalve lower */
>  	rs->rec_q = 0;
>  
> -	for (rs->bit_number = 0; rs->bit_number++ < RUBIN_REG_SIZE; rs->rec_q = rs->rec_q * 2 + (long) (pullbit(&rs->pp)))
> +	for (rs->bit_number = 0; rs->bit_number++ < RUBIN_REG_SIZE;
> +		rs->rec_q = rs->rec_q * 2 + (long) (pullbit(&rs->pp)))
>  		;
>  }
>  
> @@ -234,14 +233,14 @@ static int out_byte(struct rubin_state *rs, unsigned char byte)
>  	struct rubin_state rs_copy;
>  	rs_copy = *rs;
>  
> -	for (i=0;i<8;i++) {
> -		ret = encode(rs, rs->bit_divider-rs->bits[i],rs->bits[i],byte&1);
> +	for (i=0; i<8; i++) {

scripts/checkpatch.pl still complains:

ERROR: spaces required around that '=' (ctx:VxV)
#47: FILE: fs/jffs2/compr_rubin.c:236:
+       for (i=0; i<8; i++) {
              ^
ERROR: spaces required around that '<' (ctx:VxV)
#47: FILE: fs/jffs2/compr_rubin.c:236:
+       for (i=0; i<8; i++) {
                   ^
> +		ret = encode(rs, rs->bit_divider-rs->bits[i], rs->bits[i], byte&1);

WARNING: line over 80 characters

>  		if (ret) {
>  			/* Failed. Restore old state */
>  			*rs = rs_copy;
>  			return ret;
>  		}
> -		byte=byte>>1;
> +		byte >>= 1;
>  	}
>  	return 0;
>  }

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010

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

* [PATCH] fs: cleanup for fs/jffs2/compr_rubin.c
  2008-12-08 15:39 ` Geert Uytterhoeven
@ 2008-12-09  0:32   ` Jianjun Kong
  0 siblings, 0 replies; 4+ messages in thread
From: Jianjun Kong @ 2008-12-09  0:32 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-mtd, David.Woodhouse

On Mon, Dec 08, 2008 at 04:39:20PM +0100, Geert Uytterhoeven wrote:
>On Mon, 8 Dec 2008, Jianjun Kong wrote:
>> fs: cleanup for fs/jffs2/compr_rubin.c

<sign> 
  
>> -	for (i=0;i<8;i++) {
>> -		ret = encode(rs, rs->bit_divider-rs->bits[i],rs->bits[i],byte&1);
>> +	for (i=0; i<8; i++) {
>
>scripts/checkpatch.pl still complains:
>
>ERROR: spaces required around that '=' (ctx:VxV)
>#47: FILE: fs/jffs2/compr_rubin.c:236:
>+       for (i=0; i<8; i++) {
>              ^
>ERROR: spaces required around that '<' (ctx:VxV)
>#47: FILE: fs/jffs2/compr_rubin.c:236:
>+       for (i=0; i<8; i++) {
>                   ^
>> +		ret = encode(rs, rs->bit_divider-rs->bits[i], rs->bits[i], byte&1);
>
>WARNING: line over 80 characters

Thanks for your reply. 
Another new patch.

>From f52c81569442247b530abfdf123d2a1f44619300 Mon Sep 17 00:00:00 2001
From: Jianjun Kong <jianjun@zeuux.org>
Date: Tue, 9 Dec 2008 08:24:31 +0800
Subject: [PATCH] fs: cleanup for fs/jffs2/compr_rubin.c

remove duplicated #include and other clean

Signed-off-by: Jianjun Kong <jianjun@zeuux.org>
Reported-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
---
 fs/jffs2/compr_rubin.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/jffs2/compr_rubin.c b/fs/jffs2/compr_rubin.c
index c73fa89..35f1652 100644
--- a/fs/jffs2/compr_rubin.c
+++ b/fs/jffs2/compr_rubin.c
@@ -24,8 +24,6 @@
 #define BIT_DIVIDER_MIPS 1043
 static int bits_mips[8] = { 277,249,290,267,229,341,212,241}; /* mips32 */
 
-#include <linux/errno.h>
-
 struct pushpull {
 	unsigned char *buf;
 	unsigned int buflen;
@@ -157,7 +155,8 @@ static void init_decode(struct rubin_state *rs, int div, int *bits)
 	/* behalve lower */
 	rs->rec_q = 0;
 
-	for (rs->bit_number = 0; rs->bit_number++ < RUBIN_REG_SIZE; rs->rec_q = rs->rec_q * 2 + (long) (pullbit(&rs->pp)))
+	for (rs->bit_number = 0; rs->bit_number++ < RUBIN_REG_SIZE;
+		rs->rec_q = rs->rec_q * 2 + (long) (pullbit(&rs->pp)))
 		;
 }
 
@@ -241,7 +240,7 @@ static int out_byte(struct rubin_state *rs, unsigned char byte)
 			*rs = rs_copy;
 			return ret;
 		}
-		byte=byte>>1;
+		byte >>= 1;
 	}
 	return 0;
 }
-- 
1.5.6.3

-- 
Jianjun Kong |Happy Hacking
Homepage: http://kongove.cn
Gtalk:kongjianjun@gmail.com

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

end of thread, other threads:[~2008-12-09  0:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-06 13:18 [PATCH] fs: cleanup for fs/jffs2/compr_rubin.c Jianjun Kong
  -- strict thread matches above, loose matches on Subject: below --
2008-12-08 15:05 Jianjun Kong
2008-12-08 15:39 ` Geert Uytterhoeven
2008-12-09  0:32   ` Jianjun Kong

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