]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: xgifb: remove extra parentheses around right bit shift operations
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Wed, 4 Mar 2015 05:35:48 +0000 (07:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Mar 2015 23:22:43 +0000 (15:22 -0800)
Removes extra parentheses around bitwise right shift operations.
The cases handled here are when resultant values are assigned to
variables. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/xgifb/XGI_main_26.c

index 935c714f592a4768d9d3f41ec56b9131f05243f5..74e88200726ccd7da5f92f966517eb2e1dfe2d5c 100644 (file)
@@ -106,7 +106,7 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
 
        sr_data = XGI_CRT1Table[index].CR[5];
 
-       HDE = (XGI330_RefIndex[RefreshRateTableIndex].XRes >> 3);
+       HDE = XGI330_RefIndex[RefreshRateTableIndex].XRes >> 3;
 
        cr_data = XGI_CRT1Table[index].CR[3];
 
@@ -1011,8 +1011,8 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
                               XGIbios_mode[xgifb_info->mode_idx].mode_no);
                        return -EINVAL;
                }
-               info->fix.line_length = ((info->var.xres_virtual
-                               * info->var.bits_per_pixel) >> 6);
+               info->fix.line_length = (info->var.xres_virtual
+                               * info->var.bits_per_pixel) >> 6;
 
                xgifb_reg_set(XGISR, IND_SIS_PASSWORD, SIS_PASSWORD);