Skip to contentSkip to conversation

staging: sm750fb: Remove unnecessary parentheses

PATCH Superseded Rehas Sachdeva 2 participants 2 messages Sep 20, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: sm750fb: Remove unnecessary parentheses

Remove unnecessary parentheses from right side of an assignment. Issue detected by following Coccinelle semantic patch:

@r@
identifier x;
expression e1, e2;
@@

- x = (e1 << e2);
+ x = e1 << e2;

---
 drivers/staging/sm750fb/sm750_hw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/sm750fb/sm750_hw.c +2 -2
index a376d17..e2188e1 100644
@@ -322,8 +322,8 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc,
 		reg |= (var->xoffset & PANEL_WINDOW_WIDTH_X_MASK);
 		POKE32(PANEL_WINDOW_WIDTH, reg);
 
-		reg = ((var->yres_virtual - 1) <<
-		       PANEL_WINDOW_HEIGHT_HEIGHT_SHIFT);
+		reg = (var->yres_virtual - 1) <<
+		       PANEL_WINDOW_HEIGHT_HEIGHT_SHIFT;
 		reg &= PANEL_WINDOW_HEIGHT_HEIGHT_MASK;
 		reg |= (var->yoffset & PANEL_WINDOW_HEIGHT_Y_MASK);
 		POKE32(PANEL_WINDOW_HEIGHT, reg);
Signature · 1 line
2.7.4
#1 lore raw
Quoted 2 lines · Rehas Sachdeva

Remove unnecessary parentheses from right side of an assignment. Issue detected by following Coccinelle semantic patch:

following -> the following

Quoted 19 lines

@r@
identifier x;
expression e1, e2;
@@

- x = (e1 << e2);
+ x = e1 << e2;

---
 drivers/staging/sm750fb/sm750_hw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/sm750fb/sm750_hw.c +0 -0
index a376d17..e2188e1 100644

drivers/staging/sm750fb/sm750_hw.c int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc, · line 326

Quoted 7 lines
drivers/staging/sm750fb/sm750_hw.c +2 -2
@@ -322,8 +322,8 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc,
 		reg |= (var->xoffset & PANEL_WINDOW_WIDTH_X_MASK);
 		POKE32(PANEL_WINDOW_WIDTH, reg);
 
-		reg = ((var->yres_virtual - 1) <<
-		       PANEL_WINDOW_HEIGHT_HEIGHT_SHIFT);
+		reg = (var->yres_virtual - 1) <<
+		       PANEL_WINDOW_HEIGHT_HEIGHT_SHIFT;

Actually, PANEL_WINDOW_HEIGHT_HEIGHT_SHIFT should be moved over one space to left, to line up with the first part of the right hand side of the assignment.

julia

Quoted 13 lines
drivers/staging/sm750fb/sm750_hw.c +0 -1
 		reg &= PANEL_WINDOW_HEIGHT_HEIGHT_MASK;
 		reg |= (var->yoffset & PANEL_WINDOW_HEIGHT_Y_MASK);
 		POKE32(PANEL_WINDOW_HEIGHT, reg);
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160920122024.GA12086%40toblerone.
For more options, visit https://groups.google.com/d/optout.