Skip to contentSkip to conversation

Staging: fbtft: Remove unnecessary parenthesis and split lines to increase readability

PATCH In review Vatika Harlalka 2 participants 2 messages Mar 15, 2015 – Mar 16, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Staging: fbtft: Remove unnecessary parenthesis and split lines to increase readability

Remove unnecessary parenthesis in condition statement and split lines to increase readability.

---
Changes in v2: Changed subject line to make it more
descriptive.

 drivers/staging/fbtft/fb_ra8875.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/staging/fbtft/fb_ra8875.c +10 -6
index e21af6c..bc8ca1e 100644
@@ -72,12 +72,13 @@ static int init_display(struct fbtft_par *par)
 
 	fbtft_par_dbg(DEBUG_INIT_DISPLAY, par,
 		"%s()\n", __func__);
-	fbtft_par_dbg(DEBUG_INIT_DISPLAY, par,
-		"display size %dx%d\n", par->info->var.xres, par->info->var.yres);
+	fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "display size %dx%d\n",
+			par->info->var.xres, par->info->var.yres);
 
 	par->fbtftops.reset(par);
 
-	if ((par->info->var.xres == 320) && (par->info->var.yres == 240)) {
+	if (par->info->var.xres == 320 &&
+		par->info->var.yres == 240) {
 		/* PLL clock frequency */
 		write_reg(par, 0x88, 0x0A);
 		write_reg(par, 0x89, 0x02);
@@ -101,7 +102,8 @@ static int init_display(struct fbtft_par *par)
 		write_reg(par, 0x1D, 0x0E);
 		write_reg(par, 0x1E, 0x00);
 		write_reg(par, 0x1F, 0x02);
-	} else if ((par->info->var.xres == 480) && (par->info->var.yres == 272)) {
+	} else if (par->info->var.xres == 480 &&
+			par->info->var.yres == 272) {
 		/* PLL clock frequency  */
 		write_reg(par, 0x88, 0x0A);
 		write_reg(par, 0x89, 0x02);
@@ -125,7 +127,8 @@ static int init_display(struct fbtft_par *par)
 		write_reg(par, 0x1D, 0x07);
 		write_reg(par, 0x1E, 0x00);
 		write_reg(par, 0x1F, 0x09);
-	} else if ((par->info->var.xres == 640) && (par->info->var.yres == 480)) {
+	} else if (par->info->var.xres == 640 &&
+			par->info->var.yres == 480) {
 		/* PLL clock frequency */
 		write_reg(par, 0x88, 0x0B);
 		write_reg(par, 0x89, 0x02);
@@ -149,7 +152,8 @@ static int init_display(struct fbtft_par *par)
 		write_reg(par, 0x1D, 0x0E);
 		write_reg(par, 0x1E, 0x00);
 		write_reg(par, 0x1F, 0x01);
-	} else if ((par->info->var.xres == 800) && (par->info->var.yres == 480)) {
+	} else if (par->info->var.xres == 800 &&
+			par->info->var.yres == 480) {
 		/* PLL clock frequency */
 		write_reg(par, 0x88, 0x0B);
 		write_reg(par, 0x89, 0x02);
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 18 lines · Vatika Harlalka

Remove unnecessary parenthesis in condition statement and split lines to increase readability.

---
Changes in v2: Changed subject line to make it more
descriptive.

 drivers/staging/fbtft/fb_ra8875.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/staging/fbtft/fb_ra8875.c +0 -0
index e21af6c..bc8ca1e 100644
@@ -72,12 +72,13 @@ static int init_display(struct fbtft_par *par)
 
 	fbtft_par_dbg(DEBUG_INIT_DISPLAY, par,
 		"%s()\n", __func__);

drivers/staging/fbtft/fb_ra8875.c static int init_display(struct fbtft_par *par) · line 81

Quoted 10 lines
drivers/staging/fbtft/fb_ra8875.c +4 -3
-	fbtft_par_dbg(DEBUG_INIT_DISPLAY, par,
-		"display size %dx%d\n", par->info->var.xres, par->info->var.yres);
+	fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "display size %dx%d\n",
+			par->info->var.xres, par->info->var.yres);
 
 	par->fbtftops.reset(par);
 
-	if ((par->info->var.xres == 320) && (par->info->var.yres == 240)) {
+	if (par->info->var.xres == 320 &&
+		par->info->var.yres == 240) {

While yes, these () are not needed, it's good to keep them there, just to be "obvious" as to what is going on. So they are fine to leave alone.

thanks,

greg k-h