All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Staging: fbtft: fb_pcd8544: Fixed coding style errors and warnings
@ 2015-03-04 11:11 Cláudio Maia
  2015-03-04 11:11 ` [PATCH 2/2] " Cláudio Maia
  2015-03-07  0:45 ` [PATCH 1/2] " Greg KH
  0 siblings, 2 replies; 7+ messages in thread
From: Cláudio Maia @ 2015-03-04 11:11 UTC (permalink / raw)
  To: thomas.petazzoni, noralf, gregkh; +Cc: devel, linux-kernel

Fixed two warnings occurring in lines that are over 80 characters
and which are not comments.

Signed-off-by: Cláudio Maia <crrm@isep.ipp.pt>
---
 drivers/staging/fbtft/fb_pcd8544.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fbtft/fb_pcd8544.c b/drivers/staging/fbtft/fb_pcd8544.c
index 5e08a70..dcb1c8b 100644
--- a/drivers/staging/fbtft/fb_pcd8544.c
+++ b/drivers/staging/fbtft/fb_pcd8544.c
@@ -94,7 +94,8 @@ static int init_display(struct fbtft_par *par)
 
 static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
 {
-	fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par, "%s(xs=%d, ys=%d, xe=%d, ye=%d)\n", __func__, xs, ys, xe, ye);
+	fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par, "%s(xs=%d, ys=%d, xe=%d, ye=%d)\n",
+		      __func__, xs, ys, xe, ye);
 
 	/* H=0 Set X address of RAM */
 	write_reg(par, 0x80); /* 7:1  1
@@ -130,7 +131,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 	gpio_set_value(par->gpio.dc, 1);
 	ret = par->fbtftops.write(par, par->txbuf.buf, 6*84);
 	if (ret < 0)
-		dev_err(par->info->device, "%s: write failed and returned: %d\n", __func__, ret);
+		dev_err(par->info->device, "%s: write failed and returned: %d\n",
+			__func__, ret);
 
 	return ret;
 }
-- 
1.7.9.5


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

* [PATCH 2/2] Staging: fbtft: fb_pcd8544: Fixed coding style errors and warnings
  2015-03-04 11:11 [PATCH 1/2] Staging: fbtft: fb_pcd8544: Fixed coding style errors and warnings Cláudio Maia
@ 2015-03-04 11:11 ` Cláudio Maia
  2015-03-07  0:45 ` [PATCH 1/2] " Greg KH
  1 sibling, 0 replies; 7+ messages in thread
From: Cláudio Maia @ 2015-03-04 11:11 UTC (permalink / raw)
  To: thomas.petazzoni, noralf, gregkh; +Cc: devel, linux-kernel

This patch fixes the following errors by refactoring the comments'
style:

WARNING: line over 80 characters
ERROR: code indent should use tabs where possible

Signed-off-by: Cláudio Maia <crrm@isep.ipp.pt>
---
 drivers/staging/fbtft/fb_pcd8544.c |  107 ++++++++++++++++++++----------------
 1 file changed, 59 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/fbtft/fb_pcd8544.c b/drivers/staging/fbtft/fb_pcd8544.c
index dcb1c8b..f67e366 100644
--- a/drivers/staging/fbtft/fb_pcd8544.c
+++ b/drivers/staging/fbtft/fb_pcd8544.c
@@ -34,7 +34,7 @@
 #define WIDTH          84
 #define HEIGHT         48
 #define TXBUFLEN       (84*6)
-#define DEFAULT_GAMMA  "40" /* gamma is used to control contrast in this driver */
+#define DEFAULT_GAMMA  "40" /* gamma controls the contrast in this driver */
 
 static unsigned tc;
 module_param(tc, uint, 0);
@@ -51,43 +51,50 @@ static int init_display(struct fbtft_par *par)
 
 	par->fbtftops.reset(par);
 
-	/* Function set */
-	write_reg(par, 0x21); /* 5:1  1
-	                         2:0  PD - Powerdown control: chip is active
-							 1:0  V  - Entry mode: horizontal addressing
-							 0:1  H  - Extended instruction set control: extended
-						  */
-
-	/* H=1 Temperature control */
-	write_reg(par, 0x04 | (tc & 0x3)); /*
-	                         2:1  1
-	                         1:x  TC1 - Temperature Coefficient: 0x10
-							 0:x  TC0
-						  */
-
-	/* H=1 Bias system */
-	write_reg(par, 0x10 | (bs & 0x7)); /*
-	                         4:1  1
-	                         3:0  0
-							 2:x  BS2 - Bias System
-							 1:x  BS1
-							 0:x  BS0
-	                      */
-
-	/* Function set */
-	write_reg(par, 0x22); /* 5:1  1
-	                         2:0  PD - Powerdown control: chip is active
-							 1:1  V  - Entry mode: vertical addressing
-							 0:0  H  - Extended instruction set control: basic
-						  */
-
-	/* H=0 Display control */
-	write_reg(par, 0x08 | 4); /*
-	                         3:1  1
-	                         2:1  D  - DE: 10=normal mode
-							 1:0  0
-							 0:0  E
-						  */
+	/* Function set
+	 *
+	 * 5:1  1
+	 * 2:0  PD - Powerdown control: chip is active
+	 * 1:0  V  - Entry mode: horizontal addressing
+	 * 0:1  H  - Extended instruction set control: extended
+	 */
+	write_reg(par, 0x21);
+
+	/* H=1 Temperature control
+	 *
+	 * 2:1  1
+	 * 1:x  TC1 - Temperature Coefficient: 0x10
+	 * 0:x  TC0
+	 */
+	write_reg(par, 0x04 | (tc & 0x3));
+
+	/* H=1 Bias system
+	 *
+	 * 4:1  1
+	 * 3:0  0
+	 * 2:x  BS2 - Bias System
+	 * 1:x  BS1
+	 * 0:x  BS0
+	 */
+	write_reg(par, 0x10 | (bs & 0x7));
+
+	/* Function set
+	 *
+	 * 5:1  1
+	 * 2:0  PD - Powerdown control: chip is active
+	 * 1:1  V  - Entry mode: vertical addressing
+	 * 0:0  H  - Extended instruction set control: basic
+	 */
+	write_reg(par, 0x22);
+
+	/* H=0 Display control
+	 *
+	 * 3:1  1
+	 * 2:1  D  - DE: 10=normal mode
+	 * 1:0  0
+	 * 0:0  E
+	 */
+	write_reg(par, 0x08 | 4);
 
 	return 0;
 }
@@ -97,16 +104,20 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
 	fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par, "%s(xs=%d, ys=%d, xe=%d, ye=%d)\n",
 		      __func__, xs, ys, xe, ye);
 
-	/* H=0 Set X address of RAM */
-	write_reg(par, 0x80); /* 7:1  1
-	                         6-0: X[6:0] - 0x00
-	                      */
-
-	/* H=0 Set Y address of RAM */
-	write_reg(par, 0x40); /* 7:0  0
-	                         6:1  1
-	                         2-0: Y[2:0] - 0x0
-	                      */
+	/* H=0 Set X address of RAM
+	 *
+	 * 7:1  1
+	 * 6-0: X[6:0] - 0x00
+	 */
+	write_reg(par, 0x80);
+
+	/* H=0 Set Y address of RAM
+	 *
+	 * 7:0  0
+	 * 6:1  1
+	 * 2-0: Y[2:0] - 0x0
+	 */
+	write_reg(par, 0x40);
 }
 
 static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
-- 
1.7.9.5


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

* Re: [PATCH 1/2] Staging: fbtft: fb_pcd8544: Fixed coding style errors and warnings
  2015-03-04 11:11 [PATCH 1/2] Staging: fbtft: fb_pcd8544: Fixed coding style errors and warnings Cláudio Maia
  2015-03-04 11:11 ` [PATCH 2/2] " Cláudio Maia
@ 2015-03-07  0:45 ` Greg KH
  1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2015-03-07  0:45 UTC (permalink / raw)
  To: Cláudio Maia; +Cc: thomas.petazzoni, noralf, devel, linux-kernel

On Wed, Mar 04, 2015 at 11:11:12AM +0000, Cláudio Maia wrote:
> Fixed two warnings occurring in lines that are over 80 characters
> and which are not comments.
> 
> Signed-off-by: Cláudio Maia <crrm@isep.ipp.pt>
> ---
>  drivers/staging/fbtft/fb_pcd8544.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

This series doesn't apply properly to my tree anymore due to other
changes in these files.  Please refresh it against my staging-testing
branch of staging.git and resend it.

thanks,

greg k-h

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

* Re: [PATCH 1/2] Staging: fbtft: fb_pcd8544: Fixed coding style errors and warnings
  2015-03-03 23:47 Cláudio Maia
@ 2015-03-04  5:22 ` Sudip Mukherjee
  0 siblings, 0 replies; 7+ messages in thread
From: Sudip Mukherjee @ 2015-03-04  5:22 UTC (permalink / raw)
  To: Cláudio Maia; +Cc: thomas.petazzoni, noralf, gregkh, devel, linux-kernel

On Tue, Mar 03, 2015 at 11:47:18PM +0000, Cláudio Maia wrote:
> Fixed two warnings occurring in lines that are over 80 characters and which are not comments.
commit message should not be more than 72 characters.
> 
> Signed-off-by: Cláudio Maia <crrm@isep.ipp.pt>
> ---
<snip>
>  static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
>  {
> -	fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par, "%s(xs=%d, ys=%d, xe=%d, ye=%d)\n", __func__, xs, ys, xe, ye);
> +	fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par, "%s(xs=%d, ys=%d, xe=%d, ye=%d)\n",
> +			__func__, xs, ys, xe, ye);
Alignment should match open parenthesis

regards
sudip
>  
>  	/* H=0 Set X address of RAM */

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

* [PATCH 1/2] Staging: fbtft: fb_pcd8544: Fixed coding style errors and warnings
@ 2015-03-03 23:47 Cláudio Maia
  2015-03-04  5:22 ` Sudip Mukherjee
  0 siblings, 1 reply; 7+ messages in thread
From: Cláudio Maia @ 2015-03-03 23:47 UTC (permalink / raw)
  To: thomas.petazzoni, noralf, gregkh; +Cc: devel, linux-kernel

Fixed two warnings occurring in lines that are over 80 characters and which are not comments.

Signed-off-by: Cláudio Maia <crrm@isep.ipp.pt>
---
 drivers/staging/fbtft/fb_pcd8544.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fbtft/fb_pcd8544.c b/drivers/staging/fbtft/fb_pcd8544.c
index 5e08a70..f25053c 100644
--- a/drivers/staging/fbtft/fb_pcd8544.c
+++ b/drivers/staging/fbtft/fb_pcd8544.c
@@ -94,7 +94,8 @@ static int init_display(struct fbtft_par *par)
 
 static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
 {
-	fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par, "%s(xs=%d, ys=%d, xe=%d, ye=%d)\n", __func__, xs, ys, xe, ye);
+	fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par, "%s(xs=%d, ys=%d, xe=%d, ye=%d)\n",
+			__func__, xs, ys, xe, ye);
 
 	/* H=0 Set X address of RAM */
 	write_reg(par, 0x80); /* 7:1  1
@@ -130,7 +131,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 	gpio_set_value(par->gpio.dc, 1);
 	ret = par->fbtftops.write(par, par->txbuf.buf, 6*84);
 	if (ret < 0)
-		dev_err(par->info->device, "%s: write failed and returned: %d\n", __func__, ret);
+		dev_err(par->info->device, "%s: write failed and returned: %d\n",
+			__func__, ret);
 
 	return ret;
 }
-- 
1.7.9.5


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

* Re: [PATCH 1/2] Staging: fbtft: fb_pcd8544: Fixed coding style errors and warnings
  2015-03-03 12:54 Cláudio Maia
@ 2015-03-03 13:07 ` Dan Carpenter
  0 siblings, 0 replies; 7+ messages in thread
From: Dan Carpenter @ 2015-03-03 13:07 UTC (permalink / raw)
  To: Cláudio Maia; +Cc: thomas.petazzoni, noralf, gregkh, devel, linux-kernel

On Tue, Mar 03, 2015 at 12:54:38PM +0000, Cláudio Maia wrote:
> The following errors were fixed:
> 
> ERROR: code indent should use tabs where possible
> WARNING: line over 80 characters
> 
> Signed-off-by: Cláudio Maia <crrm@isep.ipp.pt>

Can you resend these but split up differently.

> +	write_reg(par, 0x22);/*
> +			5:1  1
> +			2:0  PD - Powerdown control: chip is active
> +			1:1  V  - Entry mode: vertical addressing
> +			0:0  H  - Extended instruction set control: basic
> +			*/
>  

These comments are all kinds of whacky looking.  You fix them in the 2/2
patch, but we don't want to have this intermidiate whacky looking patch.
Just send them when they look good like in the 2/2 patch.

> @@ -130,7 +133,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
>  	gpio_set_value(par->gpio.dc, 1);
>  	ret = par->fbtftops.write(par, par->txbuf.buf, 6*84);
>  	if (ret < 0)
> -		dev_err(par->info->device, "%s: write failed and returned: %d\n", __func__, ret);
> +		dev_err(par->info->device, "%s: write failed and returned: %d\n",
> +			__func__, ret);

Do these non-comment fixes in a separate patch.  In other words:

[patch 1/2] break up a few long lines
	this patch doesn't touch comments
[patch 2/2] make comments look good
	this is 1/2 and 2/2 comment changes combined

regards,
dan carpenter


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

* [PATCH 1/2] Staging: fbtft: fb_pcd8544: Fixed coding style errors and warnings
@ 2015-03-03 12:54 Cláudio Maia
  2015-03-03 13:07 ` Dan Carpenter
  0 siblings, 1 reply; 7+ messages in thread
From: Cláudio Maia @ 2015-03-03 12:54 UTC (permalink / raw)
  To: thomas.petazzoni, noralf, gregkh; +Cc: devel, linux-kernel

The following errors were fixed:

ERROR: code indent should use tabs where possible
WARNING: line over 80 characters

Signed-off-by: Cláudio Maia <crrm@isep.ipp.pt>
---
 drivers/staging/fbtft/fb_pcd8544.c |   74 +++++++++++++++++++-----------------
 1 file changed, 39 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/fbtft/fb_pcd8544.c b/drivers/staging/fbtft/fb_pcd8544.c
index 5e08a70..a912c1a 100644
--- a/drivers/staging/fbtft/fb_pcd8544.c
+++ b/drivers/staging/fbtft/fb_pcd8544.c
@@ -34,7 +34,7 @@
 #define WIDTH          84
 #define HEIGHT         48
 #define TXBUFLEN       (84*6)
-#define DEFAULT_GAMMA  "40" /* gamma is used to control contrast in this driver */
+#define DEFAULT_GAMMA  "40" /* gamma controls the contrast in this driver */
 
 static unsigned tc;
 module_param(tc, uint, 0);
@@ -52,60 +52,63 @@ static int init_display(struct fbtft_par *par)
 	par->fbtftops.reset(par);
 
 	/* Function set */
-	write_reg(par, 0x21); /* 5:1  1
-	                         2:0  PD - Powerdown control: chip is active
-							 1:0  V  - Entry mode: horizontal addressing
-							 0:1  H  - Extended instruction set control: extended
-						  */
+	write_reg(par, 0x21); /*
+			5:1  1
+			2:0  PD - Powerdown control: chip is active
+			1:0  V  - Entry mode: horizontal addressing
+			0:1  H  - Extended instruction set control: extended
+			*/
 
 	/* H=1 Temperature control */
 	write_reg(par, 0x04 | (tc & 0x3)); /*
-	                         2:1  1
-	                         1:x  TC1 - Temperature Coefficient: 0x10
-							 0:x  TC0
-						  */
+				2:1  1
+				1:x  TC1 - Temperature Coefficient: 0x10
+				0:x  TC0
+				*/
 
 	/* H=1 Bias system */
 	write_reg(par, 0x10 | (bs & 0x7)); /*
-	                         4:1  1
-	                         3:0  0
-							 2:x  BS2 - Bias System
-							 1:x  BS1
-							 0:x  BS0
-	                      */
+				4:1  1
+				3:0  0
+				2:x  BS2 - Bias System
+				1:x  BS1
+				0:x  BS0
+				*/
 
 	/* Function set */
-	write_reg(par, 0x22); /* 5:1  1
-	                         2:0  PD - Powerdown control: chip is active
-							 1:1  V  - Entry mode: vertical addressing
-							 0:0  H  - Extended instruction set control: basic
-						  */
+	write_reg(par, 0x22);/*
+			5:1  1
+			2:0  PD - Powerdown control: chip is active
+			1:1  V  - Entry mode: vertical addressing
+			0:0  H  - Extended instruction set control: basic
+			*/
 
 	/* H=0 Display control */
 	write_reg(par, 0x08 | 4); /*
-	                         3:1  1
-	                         2:1  D  - DE: 10=normal mode
-							 1:0  0
-							 0:0  E
-						  */
+				3:1  1
+				2:1  D  - DE: 10=normal mode
+				1:0  0
+				0:0  E
+				*/
 
 	return 0;
 }
 
 static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
 {
-	fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par, "%s(xs=%d, ys=%d, xe=%d, ye=%d)\n", __func__, xs, ys, xe, ye);
+	fbtft_par_dbg(DEBUG_SET_ADDR_WIN, par, "%s(xs=%d, ys=%d, xe=%d, ye=%d)\n",
+			__func__, xs, ys, xe, ye);
 
 	/* H=0 Set X address of RAM */
-	write_reg(par, 0x80); /* 7:1  1
-	                         6-0: X[6:0] - 0x00
-	                      */
+	write_reg(par, 0x80); /*7:1  1
+				6-0: X[6:0] - 0x00
+				*/
 
 	/* H=0 Set Y address of RAM */
-	write_reg(par, 0x40); /* 7:0  0
-	                         6:1  1
-	                         2-0: Y[2:0] - 0x0
-	                      */
+	write_reg(par, 0x40); /*7:0  0
+				6:1  1
+				2-0: Y[2:0] - 0x0
+				*/
 }
 
 static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
@@ -130,7 +133,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 	gpio_set_value(par->gpio.dc, 1);
 	ret = par->fbtftops.write(par, par->txbuf.buf, 6*84);
 	if (ret < 0)
-		dev_err(par->info->device, "%s: write failed and returned: %d\n", __func__, ret);
+		dev_err(par->info->device, "%s: write failed and returned: %d\n",
+			__func__, ret);
 
 	return ret;
 }
-- 
1.7.9.5


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

end of thread, other threads:[~2015-03-07 11:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-04 11:11 [PATCH 1/2] Staging: fbtft: fb_pcd8544: Fixed coding style errors and warnings Cláudio Maia
2015-03-04 11:11 ` [PATCH 2/2] " Cláudio Maia
2015-03-07  0:45 ` [PATCH 1/2] " Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2015-03-03 23:47 Cláudio Maia
2015-03-04  5:22 ` Sudip Mukherjee
2015-03-03 12:54 Cláudio Maia
2015-03-03 13:07 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.