Commit 159dc4bf authored by Aya Mahfouz's avatar Aya Mahfouz Committed by Greg Kroah-Hartman

staging: lustre: lclient: remove extra parentheses around right bit shift operation

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: default avatarAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 25ff6f8d
...@@ -828,7 +828,8 @@ int ccc_prep_size(const struct lu_env *env, struct cl_object *obj, ...@@ -828,7 +828,8 @@ int ccc_prep_size(const struct lu_env *env, struct cl_object *obj,
* --bug 17336 */ * --bug 17336 */
loff_t size = cl_isize_read(inode); loff_t size = cl_isize_read(inode);
loff_t cur_index = start >> PAGE_CACHE_SHIFT; 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) || if ((size == 0 && cur_index != 0) ||
size_index < cur_index) size_index < cur_index)
...@@ -1263,7 +1264,7 @@ __u32 cl_fid_build_gen(const struct lu_fid *fid) ...@@ -1263,7 +1264,7 @@ __u32 cl_fid_build_gen(const struct lu_fid *fid)
return gen; return gen;
} }
gen = (fid_flatten(fid) >> 32); gen = fid_flatten(fid) >> 32;
return gen; return gen;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment