Staging: lustre: Remove parentheses around right side an assignment
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Fri, 13 Mar 2015 17:48:53 +0000 (20:48 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Mar 2015 17:41:11 +0000 (18:41 +0100)
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: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 files changed:
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
drivers/staging/lustre/lustre/ldlm/ldlm_request.c
drivers/staging/lustre/lustre/libcfs/debug.c
drivers/staging/lustre/lustre/llite/file.c
drivers/staging/lustre/lustre/llite/lloop.c
drivers/staging/lustre/lustre/llite/rw.c
drivers/staging/lustre/lustre/lov/lov_obd.c
drivers/staging/lustre/lustre/obdclass/genops.c
drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
drivers/staging/lustre/lustre/osc/osc_io.c

index 109f44c18dd9ac138d5f0d476dc98d7b1cc92e8e..2f2f71c4c052bda675a0b635068c0f891d7e01e7 100644 (file)
@@ -2972,7 +2972,7 @@ kiblnd_start_schedulers(struct kib_sched_info *sched)
        } else {
                LASSERT(sched->ibs_nthreads <= sched->ibs_nthreads_max);
                /* 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++) {
index f815bb81fb5e5ecc9fd84a763af621351e0a640c..7586b7e4040bdc1d6c476c162eea3b19e257cfd8 100644 (file)
@@ -722,7 +722,7 @@ ksocknal_match_peerip(ksock_interface_t *iface, __u32 *ips, int nips)
                if (ips[i] == 0)
                        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;
 
                if (!(best < 0 ||
@@ -809,7 +809,7 @@ ksocknal_select_ips(ksock_peer_t *peer, __u32 *peerips, int n_peerips)
                                        continue;
 
                                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;
 
                                if (!(best_iface == NULL ||
index 92760fe94184cf7ee2455ac64364d155cbc3944e..fa7ad883bda9332509d433b3a7524fd15b2d6813 100644 (file)
@@ -1374,9 +1374,9 @@ ksocknal_sched_cansleep(ksock_sched_t *sched)
 
        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_tx_conns));
+             list_empty(&sched->kss_tx_conns);
 
        spin_unlock_bh(&sched->kss_lock);
        return rc;
index e0a8157b4e8417938594c01a91c83b0aa2bd1686..08a91f5d91b1663514889833796fdf6786c554c1 100644 (file)
@@ -152,7 +152,7 @@ void ldlm_handle_bl_callback(struct ldlm_namespace *ns,
        if (lock->l_flags & LDLM_FL_CANCEL_ON_BLOCK)
                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);
 
        if (do_ast) {
index 53226b8fff63e909c8a0566c8e43a69485d4e50f..4f713183145bb823a955a51b4dff94cb8ba17cbb 100644 (file)
@@ -307,7 +307,7 @@ int ldlm_blocking_ast_nocheck(struct ldlm_lock *lock)
        int do_ast;
 
        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);
 
        if (do_ast) {
index 54352368ac14ac7fce4287720a5fe680053cb5ed..021c92fa0333f2cd92c91b10762fcbceac7ed723 100644 (file)
@@ -409,7 +409,7 @@ int libcfs_debug_init(unsigned long bufsize)
        if (max > cfs_trace_max_debug_mb() || max < num_possible_cpus()) {
                max = TCD_MAX_PAGES;
        } else {
-               max = (max / num_possible_cpus());
+               max = max / num_possible_cpus();
                max <<= (20 - PAGE_CACHE_SHIFT);
        }
        rc = cfs_tracefile_init(max);
index 0fd113d58da0ed9e6360fd2ccd210d1d29369af4..6dab3baa80635f5674509aebbbce7b0425a78be1 100644 (file)
@@ -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_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);
        if (rc == -EAGAIN) {
                /* This close must have the epoch closed. */
index cec9254e52fa4dde661c91fa79035a29b25e787c..413a8408e3f5b97cb74518a82aaeb3e25d2b8d0d 100644 (file)
@@ -348,7 +348,7 @@ static void loop_make_request(struct request_queue *q, struct bio *old_bio)
               old_bio->bi_iter.bi_size);
 
        spin_lock_irq(&lo->lo_lock);
-       inactive = (lo->lo_state != LLOOP_BOUND);
+       inactive = lo->lo_state != LLOOP_BOUND;
        spin_unlock_irq(&lo->lo_lock);
        if (inactive)
                goto err;
index 8884a439c351aa34696674b840aca4be941bb28e..991d20c5065d3d0e83b169614cc474c54fa6d46d 100644 (file)
@@ -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
                 * to the boundary, so to avoid reading too much pages during
                 * random reading. */
-               rpc_boundary = ((end + 1) & (~(PTLRPC_MAX_BRW_PAGES - 1)));
+               rpc_boundary = (end + 1) & (~(PTLRPC_MAX_BRW_PAGES - 1));
                if (rpc_boundary > 0)
                        rpc_boundary--;
 
index 219852a14cc60f9ad39a76480ae8367d37d96487..b2ed52f20afbf9cadf9e563164a094bdf7d94654 100644 (file)
@@ -1667,8 +1667,8 @@ static int fiemap_calc_last_stripe(struct lov_stripe_md *lsm, u64 fm_start,
        int i, j;
 
        if (fm_end - fm_start > lsm->lsm_stripe_size * lsm->lsm_stripe_count) {
-               last_stripe = (start_stripe < 1 ? lsm->lsm_stripe_count - 1 :
-                                                             start_stripe - 1);
+               last_stripe = start_stripe < 1 ? lsm->lsm_stripe_count - 1 :
+                                                             start_stripe - 1;
                *stripe_count = lsm->lsm_stripe_count;
        } else {
                for (j = 0, i = start_stripe; j < lsm->lsm_stripe_count;
index 6d440b4658601c7de01c64f1f4d3320890c09493..01858b0af01c4d5b786e89c1c393ecd1d0d2bd31 100644 (file)
@@ -1221,7 +1221,7 @@ int class_connected_export(struct obd_export *exp)
        if (exp) {
                int connected;
                spin_lock(&exp->exp_lock);
-               connected = (exp->exp_conn_cnt > 0);
+               connected = exp->exp_conn_cnt > 0;
                spin_unlock(&exp->exp_lock);
                return connected;
        }
index c86598d52d53cc23e4f455248b5a6357c7834b34..4b62d25764ad79423979c7f52add70580c49a627 100644 (file)
@@ -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",
                               obd_max_dirty_pages,
                               ((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)) {
                        obd_max_dirty_pages = 4 << (20 - PAGE_CACHE_SHIFT);
                }
index fad4c135f9284dda5bf7ad744fa9d86b0b2a2b93..3c7300b0651dbf94788b2de1e68458e8abd9908e 100644 (file)
@@ -417,7 +417,7 @@ static int osc_io_setattr_start(const struct lu_env *env,
 
                        if (ia_valid & ATTR_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) {
                                attr->cat_mtime = lvb->lvb_mtime;