staging: media: lirc: remove extra parentheses around right bit shift operation
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Wed, 4 Mar 2015 05:31:19 +0000 (07:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Mar 2015 23:22:42 +0000 (15:22 -0800)
Removes extra parentheses around bitwise right shift operation.
The case handled here is when the resultant value is assigned to
a variable. 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/media/lirc/lirc_serial.c

index 19628d0104ab88a8408182b837376f985b2fce2f..9f55a83d5ab2401478fa6cb36840eb441af4d134 100644 (file)
@@ -344,7 +344,7 @@ static int init_timing_params(unsigned int new_duty_cycle,
        /* How many clocks in a microsecond?, avoiding long long divide */
        work = loops_per_sec;
        work *= 4295;  /* 4295 = 2^32 / 1e6 */
        /* How many clocks in a microsecond?, avoiding long long divide */
        work = loops_per_sec;
        work *= 4295;  /* 4295 = 2^32 / 1e6 */
-       conv_us_to_clocks = (work >> 32);
+       conv_us_to_clocks = work >> 32;
 
        /*
         * Carrier period in clocks, approach good up to 32GHz clock,
 
        /*
         * Carrier period in clocks, approach good up to 32GHz clock,