Skip to contentSkip to conversation

Fix fbtft/fb_pcd8544.c coding style errors and warnings

PATCH In review Heba Aamer 2 participants 7 messages Jan 28, 2015 – Jan 29, 2015

Subsystems (2)
lore
Share & tools
lore

Heba Aamer

author
#0 lore raw

cover Fix fbtft/fb_pcd8544.c coding style errors and warnings

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

Regarding the spaces fixes the git diff -w showed no difference, and the objdiff was empty.

Heba Aamer (5):
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 horizontal spaces errors
staging: fbtft: fix trailing whitespace
staging: fbtft: fix braces {} are not necessary for single statement
blocks

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

PATCH 1/5 staging: fbtft: fix Macros with complex values should be enclosed in parentheses

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 678ab8e..87ca96e 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
maintainer
#2 lore raw

Re: [PATCH 1/5] staging: fbtft: fix Macros with complex values should be enclosed in parentheses

Quoted 13 lines · 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 +0 -0
index 678ab8e..87ca96e 100644

drivers/staging/fbtft/fb_pcd8544.c line 39

Quoted 8 lines
drivers/staging/fbtft/fb_pcd8544.c +1 -1
@@ -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;

This is already in my tree, did you redo this series and not say a 'v2' in them?

confused,

greg k-h

author
#3 lore raw

PATCH 2/5 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 87ca96e..d0e5892 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
#4 lore raw

PATCH 3/5 staging: fbtft: fix horizontal spaces errors

In reply to Heba Aamer

This patch fixes the following checkpatch.pl errors:
spaces required around that '='
space required after that ';'
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 d0e5892..0510547 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
#5 lore raw

PATCH 4/5 staging: fbtft: fix trailing whitespace

In reply to Heba Aamer

This patch fixes the following checkpatch.pl error:
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
author
#6 lore raw

PATCH 5/5 staging: fbtft: fix braces {} are not necessary for single statement blocks

In reply to Heba Aamer

This patch fixes the following checkpatch.pl warning:
braces {} are not necessary for single statement blocks

---
 drivers/staging/fbtft/fb_pcd8544.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/fbtft/fb_pcd8544.c +1 -2
index 8b9ebfb..5e08a70 100644
@@ -120,9 +120,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 	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