linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: i4l: icn: fixed some errors and warnings caught by checkpatch.pl
@ 2016-10-04 20:53 Harman Kalra
  2016-10-05  6:52 ` Greg KH
  0 siblings, 1 reply; 12+ messages in thread
From: Harman Kalra @ 2016-10-04 20:53 UTC (permalink / raw)
  To: gregkh, sudipm.mukherjee; +Cc: devel, linux-kernel, Harman Kalra

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

Signed-off-by: Harman Kalra <harman4linux@gmail.com>
---
 drivers/staging/i4l/icn/icn.c |    3 +--
 drivers/staging/i4l/icn/icn.h |    7 ++++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index 514bfc2..3750ba3 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -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     */
 	/*
diff --git a/drivers/staging/i4l/icn/icn.h b/drivers/staging/i4l/icn/icn.h
index f8f2e76..1e5a487 100644
--- a/drivers/staging/i4l/icn/icn.h
+++ b/drivers/staging/i4l/icn/icn.h
@@ -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;
 
-- 
1.7.9.5

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

* Re: [PATCH] staging: i4l: icn: fixed some errors and warnings caught by checkpatch.pl
  2016-10-04 20:53 [PATCH] staging: i4l: icn: fixed some errors and warnings caught by checkpatch.pl Harman Kalra
@ 2016-10-05  6:52 ` Greg KH
  2016-10-07 16:57   ` [PATCH 1/3] Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed Harman Kalra
  0 siblings, 1 reply; 12+ messages in thread
From: Greg KH @ 2016-10-05  6:52 UTC (permalink / raw)
  To: Harman Kalra; +Cc: sudipm.mukherjee, devel, linux-kernel

On Wed, Oct 05, 2016 at 02:23:22AM +0530, Harman Kalra wrote:
> 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

That's three different things, please make three different patches,
don't do multiple things in the same patch.

thanks,

greg k-h

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

* [PATCH 1/3] Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed
  2016-10-05  6:52 ` Greg KH
@ 2016-10-07 16:57   ` Harman Kalra
  2016-10-07 16:57     ` [PATCH 2/3] Staging: i4l: Error "open brace { should be on the previous line" fixed Harman Kalra
                       ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Harman Kalra @ 2016-10-07 16:57 UTC (permalink / raw)
  To: gregkh, sudipm.mukherjee; +Cc: devel, linux-kernel, Harman Kalra

Warning "Prefer "pr_debug over printk(KERN_DEBUG... " and "few line more than 80 character" fixed
Signed-off-by: Harman Kalra <harman4linux@gmail.com>
---
 drivers/staging/i4l/icn/icn.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/i4l/icn/icn.h b/drivers/staging/i4l/icn/icn.h
index f8f2e76..aa4c593 100644
--- a/drivers/staging/i4l/icn/icn.h
+++ b/drivers/staging/i4l/icn/icn.h
@@ -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
-- 
1.7.9.5

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

* [PATCH 2/3] Staging: i4l: Error "open brace { should be on the previous line" fixed.
  2016-10-07 16:57   ` [PATCH 1/3] Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed Harman Kalra
@ 2016-10-07 16:57     ` Harman Kalra
  2016-10-09 15:00       ` Greg KH
  2016-10-07 16:57     ` [PATCH 3/3] Staging: i4l: Error "open brace { should be on the previous line" fixed Harman Kalra
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Harman Kalra @ 2016-10-07 16:57 UTC (permalink / raw)
  To: gregkh, sudipm.mukherjee; +Cc: devel, linux-kernel, Harman Kalra

Errors "open brace { should be on the previous line" caught by checkpatch.pl  fixed.
Signed-off-by: Harman Kalra <harman4linux@gmail.com>
---
 drivers/staging/i4l/icn/icn.h |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.h b/drivers/staging/i4l/icn/icn.h
index aa4c593..8d0182c 100644
--- a/drivers/staging/i4l/icn/icn.h
+++ b/drivers/staging/i4l/icn/icn.h
@@ -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;
 
-- 
1.7.9.5

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

* [PATCH 3/3] Staging: i4l: Error "open brace { should be on the previous line" fixed.
  2016-10-07 16:57   ` [PATCH 1/3] Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed Harman Kalra
  2016-10-07 16:57     ` [PATCH 2/3] Staging: i4l: Error "open brace { should be on the previous line" fixed Harman Kalra
@ 2016-10-07 16:57     ` Harman Kalra
  2016-10-09 14:59       ` Greg KH
  2016-10-07 20:49     ` [PATCH 1/3] Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed Joe Perches
  2016-10-09 14:59     ` Greg KH
  3 siblings, 1 reply; 12+ messages in thread
From: Harman Kalra @ 2016-10-07 16:57 UTC (permalink / raw)
  To: gregkh, sudipm.mukherjee; +Cc: devel, linux-kernel, Harman Kalra

Error "open brace { should be on the previous line" caught by checkpatch.pl fixed.
Signed-off-by: Harman Kalra <harman4linux@gmail.com>
---
 drivers/staging/i4l/icn/icn.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index 514bfc2..3750ba3 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -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     */
 	/*
-- 
1.7.9.5

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

* Re: [PATCH 1/3] Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed
  2016-10-07 16:57   ` [PATCH 1/3] Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed Harman Kalra
  2016-10-07 16:57     ` [PATCH 2/3] Staging: i4l: Error "open brace { should be on the previous line" fixed Harman Kalra
  2016-10-07 16:57     ` [PATCH 3/3] Staging: i4l: Error "open brace { should be on the previous line" fixed Harman Kalra
@ 2016-10-07 20:49     ` Joe Perches
  2016-10-09 14:59     ` Greg KH
  3 siblings, 0 replies; 12+ messages in thread
From: Joe Perches @ 2016-10-07 20:49 UTC (permalink / raw)
  To: Harman Kalra, gregkh, sudipm.mukherjee; +Cc: devel, linux-kernel

On Fri, 2016-10-07 at 22:27 +0530, Harman Kalra wrote:
> Warning "Prefer "pr_debug over printk(KERN_DEBUG... " and "few line more than 80 character" fixed

The commit subject and message doesn't match the code change.

> diff --git a/drivers/staging/i4l/icn/icn.h b/drivers/staging/i4l/icn/icn.h
[]
> @@ -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

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

* Re: [PATCH 1/3] Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed
  2016-10-07 16:57   ` [PATCH 1/3] Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed Harman Kalra
                       ` (2 preceding siblings ...)
  2016-10-07 20:49     ` [PATCH 1/3] Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed Joe Perches
@ 2016-10-09 14:59     ` Greg KH
  3 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2016-10-09 14:59 UTC (permalink / raw)
  To: Harman Kalra; +Cc: sudipm.mukherjee, devel, linux-kernel

On Fri, Oct 07, 2016 at 10:27:54PM +0530, Harman Kalra wrote:
> Warning "Prefer "pr_debug over 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

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

* Re: [PATCH 3/3] Staging: i4l: Error "open brace { should be on the previous line" fixed.
  2016-10-07 16:57     ` [PATCH 3/3] Staging: i4l: Error "open brace { should be on the previous line" fixed Harman Kalra
@ 2016-10-09 14:59       ` Greg KH
  0 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2016-10-09 14:59 UTC (permalink / raw)
  To: Harman Kalra; +Cc: sudipm.mukherjee, devel, linux-kernel

On Fri, Oct 07, 2016 at 10:27:56PM +0530, Harman Kalra wrote:
> Error "open brace { should be on the previous line" caught by checkpatch.pl fixed.
> Signed-off-by: Harman Kalra <harman4linux@gmail.com>

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

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

* Re: [PATCH 2/3] Staging: i4l: Error "open brace { should be on the previous line" fixed.
  2016-10-07 16:57     ` [PATCH 2/3] Staging: i4l: Error "open brace { should be on the previous line" fixed Harman Kalra
@ 2016-10-09 15:00       ` Greg KH
  2016-10-09 15:35         ` [PATCH 1/3] Staging: i4l: icn: Fixed open brace should be on previous line error Harman Kalra
  0 siblings, 1 reply; 12+ messages in thread
From: Greg KH @ 2016-10-09 15:00 UTC (permalink / raw)
  To: Harman Kalra; +Cc: sudipm.mukherjee, devel, linux-kernel

On Fri, Oct 07, 2016 at 10:27:55PM +0530, Harman Kalra wrote:
> Errors "open brace { should be on the previous line" caught by checkpatch.pl  fixed.

Why two ' ' characters?

> Signed-off-by: Harman Kalra <harman4linux@gmail.com>

Same blank line needed.

thanks,

greg k-h

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

* [PATCH 1/3] Staging: i4l: icn: Fixed open brace should be on previous line error
  2016-10-09 15:00       ` Greg KH
@ 2016-10-09 15:35         ` Harman Kalra
  2016-10-09 15:35           ` [PATCH 2/3] Staging: i4l: icn: prefer pr_* instead of printk Harman Kalra
  2016-10-09 15:35           ` [PATCH 3/3] Staging: i4l: icn: Fixed open brace should be on previous line error Harman Kalra
  0 siblings, 2 replies; 12+ messages in thread
From: Harman Kalra @ 2016-10-09 15:35 UTC (permalink / raw)
  To: gregkh, arnd; +Cc: sudipm.mukherjee, devel, linux-kernel, Harman Kalra

This patch resolves the following error caught by checkpatch.pl:
ERROR: that open brace { should be on the previous line

Signed-off-by: Harman Kalra <harman4linux@gmail.com>
---
 drivers/staging/i4l/icn/icn.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c
index 514bfc2..3750ba3 100644
--- a/drivers/staging/i4l/icn/icn.c
+++ b/drivers/staging/i4l/icn/icn.c
@@ -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     */
 	/*
-- 
1.7.9.5

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

* [PATCH 2/3] Staging: i4l: icn: prefer pr_* instead of printk
  2016-10-09 15:35         ` [PATCH 1/3] Staging: i4l: icn: Fixed open brace should be on previous line error Harman Kalra
@ 2016-10-09 15:35           ` Harman Kalra
  2016-10-09 15:35           ` [PATCH 3/3] Staging: i4l: icn: Fixed open brace should be on previous line error Harman Kalra
  1 sibling, 0 replies; 12+ messages in thread
From: Harman Kalra @ 2016-10-09 15:35 UTC (permalink / raw)
  To: gregkh, arnd; +Cc: sudipm.mukherjee, devel, linux-kernel, Harman Kalra

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 ...

Signed-off-by: Harman Kalra <harman4linux@gmail.com>
---
 drivers/staging/i4l/icn/icn.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/i4l/icn/icn.h b/drivers/staging/i4l/icn/icn.h
index f8f2e76..e273c27 100644
--- a/drivers/staging/i4l/icn/icn.h
+++ b/drivers/staging/i4l/icn/icn.h
@@ -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
-- 
1.7.9.5

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

* [PATCH 3/3] Staging: i4l: icn: Fixed open brace should be on previous line error
  2016-10-09 15:35         ` [PATCH 1/3] Staging: i4l: icn: Fixed open brace should be on previous line error Harman Kalra
  2016-10-09 15:35           ` [PATCH 2/3] Staging: i4l: icn: prefer pr_* instead of printk Harman Kalra
@ 2016-10-09 15:35           ` Harman Kalra
  1 sibling, 0 replies; 12+ messages in thread
From: Harman Kalra @ 2016-10-09 15:35 UTC (permalink / raw)
  To: gregkh, arnd; +Cc: sudipm.mukherjee, devel, linux-kernel, Harman Kalra

This patch resolves the following error caught by checkpatch.pl:
ERROR: that open brace { should be on the previous line

Signed-off-by: Harman Kalra <harman4linux@gmail.com>
---
 drivers/staging/i4l/icn/icn.h |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/i4l/icn/icn.h b/drivers/staging/i4l/icn/icn.h
index e273c27..07e2e01 100644
--- a/drivers/staging/i4l/icn/icn.h
+++ b/drivers/staging/i4l/icn/icn.h
@@ -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;
 
-- 
1.7.9.5

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

end of thread, other threads:[~2016-10-09 15:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-04 20:53 [PATCH] staging: i4l: icn: fixed some errors and warnings caught by checkpatch.pl Harman Kalra
2016-10-05  6:52 ` Greg KH
2016-10-07 16:57   ` [PATCH 1/3] Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed Harman Kalra
2016-10-07 16:57     ` [PATCH 2/3] Staging: i4l: Error "open brace { should be on the previous line" fixed Harman Kalra
2016-10-09 15:00       ` Greg KH
2016-10-09 15:35         ` [PATCH 1/3] Staging: i4l: icn: Fixed open brace should be on previous line error Harman Kalra
2016-10-09 15:35           ` [PATCH 2/3] Staging: i4l: icn: prefer pr_* instead of printk Harman Kalra
2016-10-09 15:35           ` [PATCH 3/3] Staging: i4l: icn: Fixed open brace should be on previous line error Harman Kalra
2016-10-07 16:57     ` [PATCH 3/3] Staging: i4l: Error "open brace { should be on the previous line" fixed Harman Kalra
2016-10-09 14:59       ` Greg KH
2016-10-07 20:49     ` [PATCH 1/3] Staging: i4l: Warning "Prefer "pr_debug over printk(KERN_DEBUG... " fixed Joe Perches
2016-10-09 14:59     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).