staging: lustre: lclient: remove extra parentheses around right bit shift operation
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Wed, 4 Mar 2015 05:29:28 +0000 (07:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Mar 2015 23:22:41 +0000 (15:22 -0800)
Removes extra parentheses around bitwise right shift operations.
The cases handled here are 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/lustre/lustre/lclient/lcommon_cl.c

index 23095bb75226b1aace10df936ba754e3803e806c..ab6cb419302fb2f0cf7cff2c3e9d97b4d8678575 100644 (file)
@@ -828,7 +828,8 @@ int ccc_prep_size(const struct lu_env *env, struct cl_object *obj,
                                 * --bug 17336 */
                                loff_t size = cl_isize_read(inode);
                                loff_t cur_index = start >> PAGE_CACHE_SHIFT;
-                               loff_t size_index = ((size - 1) >> PAGE_CACHE_SHIFT);
+                               loff_t size_index = (size - 1) >>
+                                                   PAGE_CACHE_SHIFT;
 
                                if ((size == 0 && cur_index != 0) ||
                                    size_index < cur_index)
@@ -1263,7 +1264,7 @@ __u32 cl_fid_build_gen(const struct lu_fid *fid)
                return gen;
        }
 
-       gen = (fid_flatten(fid) >> 32);
+       gen = fid_flatten(fid) >> 32;
        return gen;
 }