staging: i4l: icn: fixed some errors and warnings caught by checkpatch.pl
PATCH 1/1 staging: i4l: icn: fixed some errors and warnings caught by checkpatch.pl
2 errors "open brace { should be on the previous line" are fixed. Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed Few line more tahn 80 character warnings fixed
--- drivers/staging/i4l/icn/icn.c | 3 +-- drivers/staging/i4l/icn/icn.h | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/i4l/icn/icn.c +1 -2
@@ -411,8 +411,7 @@int action; } icn_stat;/* *INDENT-OFF* */ -static icn_stat icn_stat_table[] = -{ +static icn_stat icn_stat_table[] = { {"BCON_" ,ISDN_STAT_BCONN ,1 },/* B-Channel connected */ {"BDIS_" ,ISDN_STAT_BHUP ,2 },/* B-Channel disconnected */ /*
drivers/staging/i4l/icn/icn.h +4 -3
@@ -54,7 +54,8 @@/* some useful macros for debugging */ #ifdef ICN_DEBUG_PORT -#define OUTB_P (v, p) {printk(KERN_DEBUG "icn: outb_p(0x%02x,0x%03x)\n", v, p); outb_p(v, p);} +#define OUTB_P (v, p) \ + {pr_debug("icn: outb_p(0x%02x,0x%03x)\n", v, p); outb_p(v, p); }#else #define OUTB_P outb#endif
@@ -186,8 +187,8 @@#ifdef __KERNEL__static icn_card *cards = (icn_card *)0 ; -static u_char chan2bank[] = -{0 ,4 ,8 ,12 };/* for icn_map_channel() */ +static u_char chan2bank[] = { +0 ,4 ,8 ,12 };/* for icn_map_channel() */ static icn_dev dev;
Signature · 1 line
1.7.9.5
Greg KH
maintainerQuoted 3 lines · Harman Kalra
2 errors "open brace { should be on the previous line" are fixed. Warning "Prefer "
pr_debugover printk(KERN_DEBUG... " fixed Few line more tahn 80 character warnings fixed
That's three different things, please make three different patches, don't do multiple things in the same patch.
thanks,
greg k-h
PATCH 1/3 Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed
Warning "Prefer "pr_debug over printk(KERN_DEBUG... " and "few line more than 80 character" fixed
--- drivers/staging/i4l/icn/icn.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/i4l/icn/icn.h +2 -1
@@ -54,7 +54,8 @@/* some useful macros for debugging */ #ifdef ICN_DEBUG_PORT -#define OUTB_P (v, p) {printk(KERN_DEBUG "icn: outb_p(0x%02x,0x%03x)\n", v, p); outb_p(v, p);} +#define OUTB_P (v, p) \ + {printk(KERN_DEBUG "icn: outb_p(0x%02x,0x%03x)\n", v, p); outb_p(v, p); }#else #define OUTB_P outb#endif
Signature · 1 line
1.7.9.5
PATCH 2/3 Staging: i4l: Error "open brace { should be on the previous line" fixed.
Errors "open brace { should be on the previous line" caught by checkpatch.pl fixed.
--- drivers/staging/i4l/icn/icn.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/i4l/icn/icn.h +1 -2
@@ -187,8 +187,7 @@#ifdef __KERNEL__static icn_card *cards = (icn_card *)0 ; -static u_char chan2bank[] = -{0 ,4 ,8 ,12 };/* for icn_map_channel() */ +static u_char chan2bank[] = {0 ,4 ,8 ,12 };/* for icn_map_channel() */ static icn_dev dev;
Signature · 1 line
1.7.9.5
Greg KH
maintainerRe: [PATCH 2/3] Staging: i4l: Error "open brace { should be on the previous line" fixed.
Quoted 1 line · Harman Kalra
Errors "open brace { should be on the previous line" caught by checkpatch.pl fixed.
Why two ' ' characters?
Quoted 1 line
Signed-off-by Harman Kalra <[email protected]>
Same blank line needed.
thanks,
greg k-h
PATCH 1/3 Staging: i4l: icn: Fixed open brace should be on previous line error
This patch resolves the following error caught by checkpatch.pl:
ERROR: that open brace { should be on the previous line
--- drivers/staging/i4l/icn/icn.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/i4l/icn/icn.c +1 -2
@@ -411,8 +411,7 @@int action; } icn_stat;/* *INDENT-OFF* */ -static icn_stat icn_stat_table[] = -{ +static icn_stat icn_stat_table[] = { {"BCON_" ,ISDN_STAT_BCONN ,1 },/* B-Channel connected */ {"BDIS_" ,ISDN_STAT_BHUP ,2 },/* B-Channel disconnected */ /*
Signature · 1 line
1.7.9.5
PATCH 2/3 Staging: i4l: icn: prefer pr_* instead of printk
This patch replaces call to printk with appropriate pr_* function thus addressing the following warning generated by the checkpatch script:
Prefer [subsystem eg: netdev]_dbg([subsystem]dev, ... then
dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ...
--- drivers/staging/i4l/icn/icn.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/i4l/icn/icn.h +1 -1
@@ -54,7 +54,7 @@/* some useful macros for debugging */ #ifdef ICN_DEBUG_PORT -#define OUTB_P (v, p) {printk(KERN_DEBUG "icn: outb_p(0x%02x,0x%03x)\n", v, p); outb_p(v, p);} +#define OUTB_P (v, p) {pr_debug("icn: outb_p(0x%02x,0x%03x)\n", v, p); outb_p(v, p);}#else #define OUTB_P outb#endif
Signature · 1 line
1.7.9.5
PATCH 3/3 Staging: i4l: icn: Fixed open brace should be on previous line error
In reply to Harman KalraThis patch resolves the following error caught by checkpatch.pl:
ERROR: that open brace { should be on the previous line
--- drivers/staging/i4l/icn/icn.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/i4l/icn/icn.h +1 -2
@@ -186,8 +186,7 @@#ifdef __KERNEL__static icn_card *cards = (icn_card *)0 ; -static u_char chan2bank[] = -{0 ,4 ,8 ,12 };/* for icn_map_channel() */ +static u_char chan2bank[] = {0 ,4 ,8 ,12 };/* for icn_map_channel() */ static icn_dev dev;
Signature · 1 line
1.7.9.5
PATCH 3/3 Staging: i4l: Error "open brace { should be on the previous line" fixed.
In reply to Harman KalraError "open brace { should be on the previous line" caught by checkpatch.pl fixed.
--- drivers/staging/i4l/icn/icn.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/i4l/icn/icn.c +1 -2
@@ -411,8 +411,7 @@int action; } icn_stat;/* *INDENT-OFF* */ -static icn_stat icn_stat_table[] = -{ +static icn_stat icn_stat_table[] = { {"BCON_" ,ISDN_STAT_BCONN ,1 },/* B-Channel connected */ {"BDIS_" ,ISDN_STAT_BHUP ,2 },/* B-Channel disconnected */ /*
Signature · 1 line
1.7.9.5
Greg KH
maintainerRe: [PATCH 3/3] Staging: i4l: Error "open brace { should be on the previous line" fixed.
Quoted 2 lines · Harman Kalra
Error "open brace { should be on the previous line" caught by checkpatch.pl fixed.
Signed-off-by Harman Kalra <[email protected]>
Please put a blank line before the signed-off-by: line. As examples, look at all other commits in the tree :)
thanks,
greg k-h
Re: [PATCH 1/3] Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed
In reply to Harman KalraQuoted 1 line · Harman Kalra
Warning "Prefer "
pr_debugover printk(KERN_DEBUG... " and "few line more than 80 character" fixed
The commit subject and message doesn't match the code change.
drivers/staging/i4l/icn/icn.h
Quoted 1 line
drivers/staging/i4l/icn/icn.h +0
-0
[]
drivers/staging/i4l/icn/icn.h line 58
Quoted 7 lines
drivers/staging/i4l/icn/icn.h +2
-1@@ -54,7 +54,8 @@/* some useful macros for debugging */ #ifdef ICN_DEBUG_PORT -#define OUTB_P (v, p) {printk(KERN_DEBUG "icn: outb_p(0x%02x,0x%03x)\n", v, p); outb_p(v, p);} +#define OUTB_P (v, p) \ + {printk(KERN_DEBUG "icn: outb_p(0x%02x,0x%03x)\n", v, p); outb_p(v, p); }
This would be better with a do {...} while (0) guard
Greg KH
maintainerRe: [PATCH 1/3] Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed
In reply to Harman KalraQuoted 1 line · Harman Kalra
Warning "Prefer "
pr_debugover printk(KERN_DEBUG... " and "few line more than 80 character" fixed
That is two different things again :(
I can't take this as is...
greg k-h