staging: lustre: remove unnecessary braces
authorThibaut Robert <thibaut.robert@gmail.com>
Tue, 9 May 2017 19:46:50 +0000 (21:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 May 2017 05:41:59 +0000 (07:41 +0200)
This patch fixes checkpatch warnings: "WARNING: braces {} are not
necessary for single statement blocks" and "WARNING: braces {} are not
necessary for any arm of this statement".

Signed-off-by: Thibaut Robert <thibaut.robert@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
drivers/staging/lustre/lustre/lmv/lmv_obd.c
drivers/staging/lustre/lustre/mdc/mdc_locks.c
drivers/staging/lustre/lustre/obdclass/lu_object.c
drivers/staging/lustre/lustre/obdecho/echo_client.c
drivers/staging/lustre/lustre/osc/osc_cache.c
drivers/staging/lustre/lustre/ptlrpc/import.c

index 3663c5c..4dc7bae 100644 (file)
@@ -363,17 +363,16 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
         */
        cli->cl_chunkbits = PAGE_SHIFT;
 
-       if (!strcmp(name, LUSTRE_MDC_NAME)) {
+       if (!strcmp(name, LUSTRE_MDC_NAME))
                cli->cl_max_rpcs_in_flight = OBD_MAX_RIF_DEFAULT;
-       } else if (totalram_pages >> (20 - PAGE_SHIFT) <= 128 /* MB */) {
+       else if (totalram_pages >> (20 - PAGE_SHIFT) <= 128 /* MB */)
                cli->cl_max_rpcs_in_flight = 2;
-       } else if (totalram_pages >> (20 - PAGE_SHIFT) <= 256 /* MB */) {
+       else if (totalram_pages >> (20 - PAGE_SHIFT) <= 256 /* MB */)
                cli->cl_max_rpcs_in_flight = 3;
-       } else if (totalram_pages >> (20 - PAGE_SHIFT) <= 512 /* MB */) {
+       else if (totalram_pages >> (20 - PAGE_SHIFT) <= 512 /* MB */)
                cli->cl_max_rpcs_in_flight = 4;
-       } else {
+       else
                cli->cl_max_rpcs_in_flight = OBD_MAX_RIF_DEFAULT;
-       }
 
        spin_lock_init(&cli->cl_mod_rpcs_lock);
        spin_lock_init(&cli->cl_mod_rpcs_hist.oh_lock);
index 7325951..aaff986 100644 (file)
@@ -2413,9 +2413,8 @@ static int lmv_read_page(struct obd_export *exp, struct md_op_data *op_data,
        if (rc)
                return rc;
 
-       if (unlikely(lsm)) {
+       if (unlikely(lsm))
                return lmv_read_striped_page(exp, op_data, cb_op, offset, ppage);
-       }
 
        tgt = lmv_find_target(lmv, &op_data->op_fid1);
        if (IS_ERR(tgt))
@@ -3107,9 +3106,8 @@ static int lmv_quotactl(struct obd_device *unused, struct obd_export *exp,
                return -EIO;
        }
 
-       if (oqctl->qc_cmd != Q_GETOQUOTA) {
+       if (oqctl->qc_cmd != Q_GETOQUOTA)
                return obd_quotactl(tgt->ltd_exp, oqctl);
-       }
 
        for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
                int err;
index 392b0e3..9e06078 100644 (file)
@@ -911,13 +911,13 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
                OBD_FAIL_TIMEOUT(OBD_FAIL_MDC_ENQUEUE_PAUSE, obd_timeout);
        }
 
-       if (it->it_op & IT_CREAT) {
+       if (it->it_op & IT_CREAT)
                /* XXX this belongs in ll_create_it */
-       } else if (it->it_op == IT_OPEN) {
+               ;
+       else if (it->it_op == IT_OPEN)
                LASSERT(!it_disposition(it, DISP_OPEN_CREATE));
-       } else {
+       else
                LASSERT(it->it_op & (IT_GETATTR | IT_LOOKUP | IT_LAYOUT));
-       }
 
        /* If we already have a matching lock, then cancel the new
         * one.  We have to set the data here instead of in
index abcf951..94c8ae5 100644 (file)
@@ -918,9 +918,8 @@ static unsigned long lu_htable_order(struct lu_device *top)
        cache_size = cache_size / 100 * lu_cache_percent *
                (PAGE_SIZE / 1024);
 
-       for (bits = 1; (1 << bits) < cache_size; ++bits) {
+       for (bits = 1; (1 << bits) < cache_size; ++bits)
                ;
-       }
        return clamp_t(typeof(bits), bits, LU_SITE_BITS_MIN, bits_max);
 }
 
index 77b4c55..d476831 100644 (file)
@@ -1646,9 +1646,8 @@ static int echo_client_connect(const struct lu_env *env,
        struct lustre_handle conn = { 0 };
 
        rc = class_connect(&conn, src, cluuid);
-       if (rc == 0) {
+       if (rc == 0)
                *exp = class_conn2export(&conn);
-       }
 
        return rc;
 }
index c5ccf56..33d769c 100644 (file)
@@ -1406,9 +1406,8 @@ static void osc_release_write_grant(struct client_obd *cli,
                                    struct brw_page *pga)
 {
        assert_spin_locked(&cli->cl_loi_list_lock);
-       if (!(pga->flag & OBD_BRW_FROM_GRANT)) {
+       if (!(pga->flag & OBD_BRW_FROM_GRANT))
                return;
-       }
 
        pga->flag &= ~OBD_BRW_FROM_GRANT;
        atomic_long_dec(&obd_dirty_pages);
index 93e172f..52cb1f0 100644 (file)
@@ -1182,17 +1182,15 @@ static int ptlrpc_connect_interpret(const struct lu_env *env,
        }
 
        /* Sanity checks for a reconnected import. */
-       if (!(imp->imp_replayable) != !(msg_flags & MSG_CONNECT_REPLAYABLE)) {
+       if (!(imp->imp_replayable) != !(msg_flags & MSG_CONNECT_REPLAYABLE))
                CERROR("imp_replayable flag does not match server after reconnect. We should LBUG right here.\n");
-       }
 
        if (lustre_msg_get_last_committed(request->rq_repmsg) > 0 &&
            lustre_msg_get_last_committed(request->rq_repmsg) <
-           aa->pcaa_peer_committed) {
+           aa->pcaa_peer_committed)
                CERROR("%s went back in time (transno %lld was previously committed, server now claims %lld)!  See https://bugzilla.lustre.org/show_bug.cgi?id=9646\n",
                       obd2cli_tgt(imp->imp_obd), aa->pcaa_peer_committed,
                       lustre_msg_get_last_committed(request->rq_repmsg));
-       }
 
 finish:
        ptlrpc_prepare_replay(imp);
@@ -1437,20 +1435,17 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp)
                rc = 0;
        }
 
-       if (imp->imp_state == LUSTRE_IMP_REPLAY_LOCKS) {
+       if (imp->imp_state == LUSTRE_IMP_REPLAY_LOCKS)
                if (atomic_read(&imp->imp_replay_inflight) == 0) {
                        IMPORT_SET_STATE(imp, LUSTRE_IMP_REPLAY_WAIT);
                        rc = signal_completed_replay(imp);
                        if (rc)
                                goto out;
                }
-       }
 
-       if (imp->imp_state == LUSTRE_IMP_REPLAY_WAIT) {
-               if (atomic_read(&imp->imp_replay_inflight) == 0) {
+       if (imp->imp_state == LUSTRE_IMP_REPLAY_WAIT)
+               if (atomic_read(&imp->imp_replay_inflight) == 0)
                        IMPORT_SET_STATE(imp, LUSTRE_IMP_RECOVER);
-               }
-       }
 
        if (imp->imp_state == LUSTRE_IMP_RECOVER) {
                CDEBUG(D_HA, "reconnected to %s@%s\n",