Skip to contentSkip to conversation

Fix fbtft/fb_pcd8544.c coding style errors

PATCH In review Heba Aamer 2 participants 8 messages Jan 27, 2015

Subsystems (2)
lore
Share & tools
lore

Heba Aamer

author
#0 lore raw

cover Fix fbtft/fb_pcd8544.c coding style errors

This patch set fixes most of the checkpatch.pl coding style errors found in drivers/staging/fbtft/fb_pcd8544.c

Heba Aamer (6):
staging: fbtft: fix space required after that ';'
staging: fbtft: fix spaces required around that '='
staging: fbtft: fix spaces required around that '<'
staging: fbtft: fix Macros with complex values should be enclosed in
parentheses
staging: fbtft: fix do not initialise statics to 0 or NULL
staging: fbtft: fix trailing whitespace

 drivers/staging/fbtft/fb_pcd8544.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/6 staging: fbtft: fix space required after that ';'

This patch fixes the following checkpatch.pl error:
fix space required after that ';'

---
 drivers/staging/fbtft/fb_pcd8544.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/fbtft/fb_pcd8544.c +3 -3
index 678ab8e..387190d 100644
@@ -117,10 +117,10 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 
 	fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s()\n", __func__);
 
-	for (x=0;x<84;x++) {
-		for (y=0;y<6;y++) {
+	for (x=0; x<84; x++) {
+		for (y=0; y<6; y++) {
 			*buf = 0x00;
-			for (i=0;i<8;i++) {
+			for (i=0; i<8; i++) {
 				*buf |= (vmem16[(y*8+i)*84+x] ? 1 : 0) << i;
 			}
 			buf++;
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH 2/6 staging: fbtft: fix spaces required around that '='

In reply to Heba Aamer

This patch fixes the following checkpatch.pl error:
fix spaces required around that '='

---
 drivers/staging/fbtft/fb_pcd8544.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/fbtft/fb_pcd8544.c +3 -3
index 387190d..ed0922d 100644
@@ -117,10 +117,10 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 
 	fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s()\n", __func__);
 
-	for (x=0; x<84; x++) {
-		for (y=0; y<6; y++) {
+	for (x = 0; x<84; x++) {
+		for (y = 0; y<6; y++) {
 			*buf = 0x00;
-			for (i=0; i<8; i++) {
+			for (i = 0; i<8; i++) {
 				*buf |= (vmem16[(y*8+i)*84+x] ? 1 : 0) << i;
 			}
 			buf++;
Signature · 1 line
1.7.9.5
author
#3 lore raw

PATCH 3/6 staging: fbtft: fix spaces required around that '<'

In reply to Heba Aamer

This patch fixes the following checkpatch.pl error:
fix spaces required around that '<'

---
 drivers/staging/fbtft/fb_pcd8544.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/fbtft/fb_pcd8544.c +3 -3
index ed0922d..dd72bed 100644
@@ -117,10 +117,10 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 
 	fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s()\n", __func__);
 
-	for (x = 0; x<84; x++) {
-		for (y = 0; y<6; y++) {
+	for (x = 0; x < 84; x++) {
+		for (y = 0; y < 6; y++) {
 			*buf = 0x00;
-			for (i = 0; i<8; i++) {
+			for (i = 0; i < 8; i++) {
 				*buf |= (vmem16[(y*8+i)*84+x] ? 1 : 0) << i;
 			}
 			buf++;
Signature · 1 line
1.7.9.5
author
#4 lore raw

PATCH 4/6 staging: fbtft: fix Macros with complex values should be enclosed in parentheses

In reply to Heba Aamer

This patch fixes the following checkpatch.pl error:
fix Macros with complex values should be enclosed in parentheses

---
 drivers/staging/fbtft/fb_pcd8544.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fbtft/fb_pcd8544.c +1 -1
index dd72bed..d20d432 100644
@@ -33,7 +33,7 @@
 #define DRVNAME	       "fb_pcd8544"
 #define WIDTH          84
 #define HEIGHT         48
-#define TXBUFLEN       84*6
+#define TXBUFLEN       (84*6)
 #define DEFAULT_GAMMA  "40" /* gamma is used to control contrast in this driver */
 
 static unsigned tc = 0;
Signature · 1 line
1.7.9.5
author
#5 lore raw

PATCH 5/6 staging: fbtft: fix do not initialise statics to 0 or NULL

In reply to Heba Aamer

This patch fixes the following checkpatch.pl error:
fix do not initialise statics to 0 or NULL

---
 drivers/staging/fbtft/fb_pcd8544.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fbtft/fb_pcd8544.c +1 -1
index d20d432..0510547 100644
@@ -36,7 +36,7 @@
 #define TXBUFLEN       (84*6)
 #define DEFAULT_GAMMA  "40" /* gamma is used to control contrast in this driver */
 
-static unsigned tc = 0;
+static unsigned tc;
 module_param(tc, uint, 0);
 MODULE_PARM_DESC(tc, "TC[1:0] Temperature coefficient: 0-3 (default: 0)");
 
Signature · 1 line
1.7.9.5
author
#6 lore raw

PATCH 6/6 staging: fbtft: fix trailing whitespace

In reply to Heba Aamer

This patch fixes the following checkpatch.pl error:
fix trailing whitespace

---
 drivers/staging/fbtft/fb_pcd8544.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/fbtft/fb_pcd8544.c +3 -3
index 0510547..8b9ebfb 100644
@@ -59,14 +59,14 @@ static int init_display(struct fbtft_par *par)
 						  */
 
 	/* H=1 Temperature control */
-	write_reg(par, 0x04 | (tc & 0x3)); /* 
+	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)); /* 
+	write_reg(par, 0x10 | (bs & 0x7)); /*
 	                         4:1  1
 	                         3:0  0
 							 2:x  BS2 - Bias System
@@ -82,7 +82,7 @@ static int init_display(struct fbtft_par *par)
 						  */
 
 	/* H=0 Display control */
-	write_reg(par, 0x08 | 4); /* 
+	write_reg(par, 0x08 | 4); /*
 	                         3:1  1
 	                         2:1  D  - DE: 10=normal mode
 							 1:0  0
Signature · 1 line
1.7.9.5
#7 lore raw
In reply to Heba Aamer
Quoted 7 lines · Heba Aamer

This patch set fixes most of the checkpatch.pl coding style errors found in drivers/staging/fbtft/fb_pcd8544.c

Heba Aamer (6):
staging: fbtft: fix space required after that ';'
staging: fbtft: fix spaces required around that '='
staging: fbtft: fix spaces required around that '<'

I suppose this is OK, but I think it's better to do all the horizontal whitespace changes in the same patch.

It's trivial and easy to verify all-at-once instead of modifying the same line multiple times.

It's also nice to say that git diff -w shows no difference and that objdiff is empty.

Quoted 1 line

staging: fbtft: fix trailing whitespace