Commit b6ee3824 authored by Haneen Mohammed's avatar Haneen Mohammed Committed by Greg Kroah-Hartman

Staging: lustre: Remove parentheses around right side an assignment

Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurenses. Issue was detected and
solved using the following coccinelle script:

@rule1@
identifier x, y, z;
expression E1, E2;
@@

(
x = (y == z);
|
x = (E1 == E2);
|
 x =
-(
...
-)
 ;
)
Signed-off-by: default avatarHaneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b4e3e6ee
...@@ -2972,7 +2972,7 @@ kiblnd_start_schedulers(struct kib_sched_info *sched) ...@@ -2972,7 +2972,7 @@ kiblnd_start_schedulers(struct kib_sched_info *sched)
} else { } else {
LASSERT(sched->ibs_nthreads <= sched->ibs_nthreads_max); LASSERT(sched->ibs_nthreads <= sched->ibs_nthreads_max);
/* increase one thread if there is new interface */ /* increase one thread if there is new interface */
nthrs = (sched->ibs_nthreads < sched->ibs_nthreads_max); nthrs = sched->ibs_nthreads < sched->ibs_nthreads_max;
} }
for (i = 0; i < nthrs; i++) { for (i = 0; i < nthrs; i++) {
......
...@@ -722,7 +722,7 @@ ksocknal_match_peerip(ksock_interface_t *iface, __u32 *ips, int nips) ...@@ -722,7 +722,7 @@ ksocknal_match_peerip(ksock_interface_t *iface, __u32 *ips, int nips)
if (ips[i] == 0) if (ips[i] == 0)
continue; continue;
this_xor = (ips[i] ^ iface->ksni_ipaddr); this_xor = ips[i] ^ iface->ksni_ipaddr;
this_netmatch = ((this_xor & iface->ksni_netmask) == 0) ? 1 : 0; this_netmatch = ((this_xor & iface->ksni_netmask) == 0) ? 1 : 0;
if (!(best < 0 || if (!(best < 0 ||
...@@ -809,7 +809,7 @@ ksocknal_select_ips(ksock_peer_t *peer, __u32 *peerips, int n_peerips) ...@@ -809,7 +809,7 @@ ksocknal_select_ips(ksock_peer_t *peer, __u32 *peerips, int n_peerips)
continue; continue;
k = ksocknal_match_peerip(iface, peerips, n_peerips); k = ksocknal_match_peerip(iface, peerips, n_peerips);
xor = (ip ^ peerips[k]); xor = ip ^ peerips[k];
this_netmatch = ((xor & iface->ksni_netmask) == 0) ? 1 : 0; this_netmatch = ((xor & iface->ksni_netmask) == 0) ? 1 : 0;
if (!(best_iface == NULL || if (!(best_iface == NULL ||
......
...@@ -1374,9 +1374,9 @@ ksocknal_sched_cansleep(ksock_sched_t *sched) ...@@ -1374,9 +1374,9 @@ ksocknal_sched_cansleep(ksock_sched_t *sched)
spin_lock_bh(&sched->kss_lock); spin_lock_bh(&sched->kss_lock);
rc = (!ksocknal_data.ksnd_shuttingdown && rc = !ksocknal_data.ksnd_shuttingdown &&
list_empty(&sched->kss_rx_conns) && list_empty(&sched->kss_rx_conns) &&
list_empty(&sched->kss_tx_conns)); list_empty(&sched->kss_tx_conns);
spin_unlock_bh(&sched->kss_lock); spin_unlock_bh(&sched->kss_lock);
return rc; return rc;
......
...@@ -152,7 +152,7 @@ void ldlm_handle_bl_callback(struct ldlm_namespace *ns, ...@@ -152,7 +152,7 @@ void ldlm_handle_bl_callback(struct ldlm_namespace *ns,
if (lock->l_flags & LDLM_FL_CANCEL_ON_BLOCK) if (lock->l_flags & LDLM_FL_CANCEL_ON_BLOCK)
lock->l_flags |= LDLM_FL_CANCEL; lock->l_flags |= LDLM_FL_CANCEL;
do_ast = (!lock->l_readers && !lock->l_writers); do_ast = !lock->l_readers && !lock->l_writers;
unlock_res_and_lock(lock); unlock_res_and_lock(lock);
if (do_ast) { if (do_ast) {
......
...@@ -307,7 +307,7 @@ int ldlm_blocking_ast_nocheck(struct ldlm_lock *lock) ...@@ -307,7 +307,7 @@ int ldlm_blocking_ast_nocheck(struct ldlm_lock *lock)
int do_ast; int do_ast;
lock->l_flags |= LDLM_FL_CBPENDING; lock->l_flags |= LDLM_FL_CBPENDING;
do_ast = (!lock->l_readers && !lock->l_writers); do_ast = !lock->l_readers && !lock->l_writers;
unlock_res_and_lock(lock); unlock_res_and_lock(lock);
if (do_ast) { if (do_ast) {
......
...@@ -409,7 +409,7 @@ int libcfs_debug_init(unsigned long bufsize) ...@@ -409,7 +409,7 @@ int libcfs_debug_init(unsigned long bufsize)
if (max > cfs_trace_max_debug_mb() || max < num_possible_cpus()) { if (max > cfs_trace_max_debug_mb() || max < num_possible_cpus()) {
max = TCD_MAX_PAGES; max = TCD_MAX_PAGES;
} else { } else {
max = (max / num_possible_cpus()); max = max / num_possible_cpus();
max <<= (20 - PAGE_CACHE_SHIFT); max <<= (20 - PAGE_CACHE_SHIFT);
} }
rc = cfs_tracefile_init(max); rc = cfs_tracefile_init(max);
......
...@@ -161,7 +161,7 @@ static int ll_close_inode_openhandle(struct obd_export *md_exp, ...@@ -161,7 +161,7 @@ static int ll_close_inode_openhandle(struct obd_export *md_exp,
op_data->op_lease_handle = och->och_lease_handle; op_data->op_lease_handle = och->och_lease_handle;
op_data->op_attr.ia_valid |= ATTR_SIZE | ATTR_BLOCKS; op_data->op_attr.ia_valid |= ATTR_SIZE | ATTR_BLOCKS;
} }
epoch_close = (op_data->op_flags & MF_EPOCH_CLOSE); epoch_close = op_data->op_flags & MF_EPOCH_CLOSE;
rc = md_close(md_exp, op_data, och->och_mod, &req); rc = md_close(md_exp, op_data, och->och_mod, &req);
if (rc == -EAGAIN) { if (rc == -EAGAIN) {
/* This close must have the epoch closed. */ /* This close must have the epoch closed. */
......
...@@ -348,7 +348,7 @@ static void loop_make_request(struct request_queue *q, struct bio *old_bio) ...@@ -348,7 +348,7 @@ static void loop_make_request(struct request_queue *q, struct bio *old_bio)
old_bio->bi_iter.bi_size); old_bio->bi_iter.bi_size);
spin_lock_irq(&lo->lo_lock); spin_lock_irq(&lo->lo_lock);
inactive = (lo->lo_state != LLOOP_BOUND); inactive = lo->lo_state != LLOOP_BOUND;
spin_unlock_irq(&lo->lo_lock); spin_unlock_irq(&lo->lo_lock);
if (inactive) if (inactive)
goto err; goto err;
......
...@@ -750,7 +750,7 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io, ...@@ -750,7 +750,7 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io,
/* Note: we only trim the RPC, instead of extending the RPC /* Note: we only trim the RPC, instead of extending the RPC
* to the boundary, so to avoid reading too much pages during * to the boundary, so to avoid reading too much pages during
* random reading. */ * random reading. */
rpc_boundary = ((end + 1) & (~(PTLRPC_MAX_BRW_PAGES - 1))); rpc_boundary = (end + 1) & (~(PTLRPC_MAX_BRW_PAGES - 1));
if (rpc_boundary > 0) if (rpc_boundary > 0)
rpc_boundary--; rpc_boundary--;
......
...@@ -1667,8 +1667,8 @@ static int fiemap_calc_last_stripe(struct lov_stripe_md *lsm, u64 fm_start, ...@@ -1667,8 +1667,8 @@ static int fiemap_calc_last_stripe(struct lov_stripe_md *lsm, u64 fm_start,
int i, j; int i, j;
if (fm_end - fm_start > lsm->lsm_stripe_size * lsm->lsm_stripe_count) { if (fm_end - fm_start > lsm->lsm_stripe_size * lsm->lsm_stripe_count) {
last_stripe = (start_stripe < 1 ? lsm->lsm_stripe_count - 1 : last_stripe = start_stripe < 1 ? lsm->lsm_stripe_count - 1 :
start_stripe - 1); start_stripe - 1;
*stripe_count = lsm->lsm_stripe_count; *stripe_count = lsm->lsm_stripe_count;
} else { } else {
for (j = 0, i = start_stripe; j < lsm->lsm_stripe_count; for (j = 0, i = start_stripe; j < lsm->lsm_stripe_count;
......
...@@ -1221,7 +1221,7 @@ int class_connected_export(struct obd_export *exp) ...@@ -1221,7 +1221,7 @@ int class_connected_export(struct obd_export *exp)
if (exp) { if (exp) {
int connected; int connected;
spin_lock(&exp->exp_lock); spin_lock(&exp->exp_lock);
connected = (exp->exp_conn_cnt > 0); connected = exp->exp_conn_cnt > 0;
spin_unlock(&exp->exp_lock); spin_unlock(&exp->exp_lock);
return connected; return connected;
} }
......
...@@ -206,7 +206,7 @@ static int proc_max_dirty_pages_in_mb(struct ctl_table *table, int write, ...@@ -206,7 +206,7 @@ static int proc_max_dirty_pages_in_mb(struct ctl_table *table, int write,
CERROR("Refusing to set max dirty pages to %u, which is more than 90%% of available RAM; setting to %lu\n", CERROR("Refusing to set max dirty pages to %u, which is more than 90%% of available RAM; setting to %lu\n",
obd_max_dirty_pages, obd_max_dirty_pages,
((totalram_pages / 10) * 9)); ((totalram_pages / 10) * 9));
obd_max_dirty_pages = ((totalram_pages / 10) * 9); obd_max_dirty_pages = (totalram_pages / 10) * 9;
} else if (obd_max_dirty_pages < 4 << (20 - PAGE_CACHE_SHIFT)) { } else if (obd_max_dirty_pages < 4 << (20 - PAGE_CACHE_SHIFT)) {
obd_max_dirty_pages = 4 << (20 - PAGE_CACHE_SHIFT); obd_max_dirty_pages = 4 << (20 - PAGE_CACHE_SHIFT);
} }
......
...@@ -417,7 +417,7 @@ static int osc_io_setattr_start(const struct lu_env *env, ...@@ -417,7 +417,7 @@ static int osc_io_setattr_start(const struct lu_env *env,
if (ia_valid & ATTR_SIZE) { if (ia_valid & ATTR_SIZE) {
attr->cat_size = attr->cat_kms = size; attr->cat_size = attr->cat_kms = size;
cl_valid = (CAT_SIZE | CAT_KMS); cl_valid = CAT_SIZE | CAT_KMS;
} }
if (ia_valid & ATTR_MTIME_SET) { if (ia_valid & ATTR_MTIME_SET) {
attr->cat_mtime = lvb->lvb_mtime; attr->cat_mtime = lvb->lvb_mtime;
......
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