staging: slicoss: remove extra parentheses around right bit shift operations
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Wed, 4 Mar 2015 05:34:52 +0000 (07:34 +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
,...);

Some coding style issues were handled manually to avoid
checkpatch warnings and errors.

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

index 45f6a5fce963d7e2958ad5712ccef3b37c38410f..c84dd6062a03ac5b659034b146adfa57be167987 100644 (file)
@@ -164,7 +164,7 @@ static void slic_mcast_set_bit(struct adapter *adapter, char *address)
        /* Get the CRC polynomial for the mac address */
        /* we use bits 1-8 (lsb), bitwise reversed,
         * msb (= lsb bit 0 before bitrev) is automatically discarded */
-       crcpoly = (ether_crc(ETH_ALEN, address)>>23);
+       crcpoly = ether_crc(ETH_ALEN, address)>>23;
 
        /* We only have space on the SLIC for 64 entries.  Lop
         * off the top two bits. (2^6 = 64)
@@ -1862,8 +1862,8 @@ static void slic_xmit_build_request(struct adapter *adapter,
        hcmd->cmdsize = (u32) ((((u64)&ihcmd->u.slic_buffers.bufs[1] -
                                     (u64) hcmd) + 31) >> 5);
 #else
-       hcmd->cmdsize = ((((u32) &ihcmd->u.slic_buffers.bufs[1] -
-                          (u32) hcmd) + 31) >> 5);
+       hcmd->cmdsize = (((u32)&ihcmd->u.slic_buffers.bufs[1] -
+                                      (u32)hcmd) + 31) >> 5;
 #endif
 }
 
This page took 0.031942 seconds and 5 git commands to generate.