staging: lustre: cleanup comment style for lnet selftest
authorJames Simmons <jsimmons@infradead.org>
Sat, 12 Mar 2016 18:00:36 +0000 (13:00 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
Apply a consistent style for comments in the lnet selftest
code. Realign some of the comments to make it easier to read.
This also fixes a few checkpatch issues as well.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/selftest/brw_test.c
drivers/staging/lustre/lnet/selftest/conctl.c
drivers/staging/lustre/lnet/selftest/conrpc.c
drivers/staging/lustre/lnet/selftest/console.c
drivers/staging/lustre/lnet/selftest/framework.c
drivers/staging/lustre/lnet/selftest/ping_test.c
drivers/staging/lustre/lnet/selftest/rpc.c
drivers/staging/lustre/lnet/selftest/timer.c

index 69812fc3c9ed83ae33245e077e8d4896304e1050..b33c35694eb1f3bddb6e00d479a3f59da7a2ad3e 100644 (file)
@@ -327,7 +327,7 @@ brw_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
        if (rpc->crpc_status) {
                CERROR("BRW RPC to %s failed with %d\n",
                       libcfs_id2str(rpc->crpc_dest), rpc->crpc_status);
-               if (!tsi->tsi_stopping) /* rpc could have been aborted */
+               if (!tsi->tsi_stopping) /* rpc could have been aborted */
                        atomic_inc(&sn->sn_brw_errors);
                return;
        }
index 5c7cb72eac9a5b4ff59162b06aacd8352a26f38c..6e2a81d8e7300e55a0ad735d14dda62624289653 100644 (file)
@@ -51,9 +51,9 @@ lst_session_new_ioctl(lstio_session_new_args_t *args)
        char *name;
        int rc;
 
-       if (!args->lstio_ses_idp || /* address for output sid */
-           !args->lstio_ses_key ||    /* no key is specified */
-           !args->lstio_ses_namep || /* session name */
+       if (!args->lstio_ses_idp ||     /* address for output sid */
+           !args->lstio_ses_key ||     /* no key is specified */
+           !args->lstio_ses_namep ||   /* session name */
            args->lstio_ses_nmlen <= 0 ||
            args->lstio_ses_nmlen > LST_NAME_SIZE)
                return -EINVAL;
@@ -95,11 +95,11 @@ lst_session_info_ioctl(lstio_session_info_args_t *args)
 {
        /* no checking of key */
 
-       if (!args->lstio_ses_idp || /* address for output sid */
-           !args->lstio_ses_keyp || /* address for output key */
-           !args->lstio_ses_featp || /* address for output features */
-           !args->lstio_ses_ndinfo || /* address for output ndinfo */
-           !args->lstio_ses_namep || /* address for output name */
+       if (!args->lstio_ses_idp ||     /* address for output sid */
+           !args->lstio_ses_keyp ||    /* address for output key */
+           !args->lstio_ses_featp ||   /* address for output features */
+           !args->lstio_ses_ndinfo ||  /* address for output ndinfo */
+           !args->lstio_ses_namep ||   /* address for output name */
            args->lstio_ses_nmlen <= 0 ||
            args->lstio_ses_nmlen > LST_NAME_SIZE)
                return -EINVAL;
@@ -125,7 +125,7 @@ lst_debug_ioctl(lstio_debug_args_t *args)
        if (!args->lstio_dbg_resultp)
                return -EINVAL;
 
-       if (args->lstio_dbg_namep && /* name of batch/group */
+       if (args->lstio_dbg_namep &&    /* name of batch/group */
            (args->lstio_dbg_nmlen <= 0 ||
             args->lstio_dbg_nmlen > LST_NAME_SIZE))
                return -EINVAL;
@@ -326,7 +326,7 @@ lst_nodes_add_ioctl(lstio_group_nodes_args_t *args)
        if (args->lstio_grp_key != console_session.ses_key)
                return -EACCES;
 
-       if (!args->lstio_grp_idsp || /* array of ids */
+       if (!args->lstio_grp_idsp ||    /* array of ids */
            args->lstio_grp_count <= 0 ||
            !args->lstio_grp_resultp ||
            !args->lstio_grp_featp ||
@@ -394,13 +394,13 @@ lst_group_info_ioctl(lstio_group_info_args_t *args)
            args->lstio_grp_nmlen > LST_NAME_SIZE)
                return -EINVAL;
 
-       if (!args->lstio_grp_entp &&  /* output: group entry */
-           !args->lstio_grp_dentsp)  /* output: node entry */
+       if (!args->lstio_grp_entp &&    /* output: group entry */
+           !args->lstio_grp_dentsp)    /* output: node entry */
                return -EINVAL;
 
-       if (args->lstio_grp_dentsp) { /* have node entry */
-               if (!args->lstio_grp_idxp || /* node index */
-                   !args->lstio_grp_ndentp) /* # of node entry */
+       if (args->lstio_grp_dentsp) {           /* have node entry */
+               if (!args->lstio_grp_idxp ||    /* node index */
+                   !args->lstio_grp_ndentp)    /* # of node entry */
                        return -EINVAL;
 
                if (copy_from_user(&ndent, args->lstio_grp_ndentp,
@@ -612,18 +612,18 @@ lst_batch_info_ioctl(lstio_batch_info_args_t *args)
        if (args->lstio_bat_key != console_session.ses_key)
                return -EACCES;
 
-       if (!args->lstio_bat_namep || /* batch name */
+       if (!args->lstio_bat_namep ||   /* batch name */
            args->lstio_bat_nmlen <= 0 ||
            args->lstio_bat_nmlen > LST_NAME_SIZE)
                return -EINVAL;
 
-       if (!args->lstio_bat_entp && /* output: batch entry */
-           !args->lstio_bat_dentsp) /* output: node entry */
+       if (!args->lstio_bat_entp &&    /* output: batch entry */
+           !args->lstio_bat_dentsp)    /* output: node entry */
                return -EINVAL;
 
-       if (args->lstio_bat_dentsp) { /* have node entry */
-               if (!args->lstio_bat_idxp || /* node index */
-                   !args->lstio_bat_ndentp) /* # of node entry */
+       if (args->lstio_bat_dentsp) {           /* have node entry */
+               if (!args->lstio_bat_idxp ||    /* node index */
+                   !args->lstio_bat_ndentp)    /* # of node entry */
                        return -EINVAL;
 
                if (copy_from_user(&index, args->lstio_bat_idxp,
@@ -722,18 +722,18 @@ static int lst_test_add_ioctl(lstio_test_args_t *args)
 
        if (!args->lstio_tes_resultp ||
            !args->lstio_tes_retp ||
-           !args->lstio_tes_bat_name || /* no specified batch */
+           !args->lstio_tes_bat_name ||        /* no specified batch */
            args->lstio_tes_bat_nmlen <= 0 ||
            args->lstio_tes_bat_nmlen > LST_NAME_SIZE ||
-           !args->lstio_tes_sgrp_name || /* no source group */
+           !args->lstio_tes_sgrp_name ||       /* no source group */
            args->lstio_tes_sgrp_nmlen <= 0 ||
            args->lstio_tes_sgrp_nmlen > LST_NAME_SIZE ||
-           !args->lstio_tes_dgrp_name || /* no target group */
+           !args->lstio_tes_dgrp_name ||       /* no target group */
            args->lstio_tes_dgrp_nmlen <= 0 ||
            args->lstio_tes_dgrp_nmlen > LST_NAME_SIZE)
                return -EINVAL;
 
-       if (!args->lstio_tes_loop || /* negative is infinite */
+       if (!args->lstio_tes_loop ||            /* negative is infinite */
            args->lstio_tes_concur <= 0 ||
            args->lstio_tes_dist <= 0 ||
            args->lstio_tes_span <= 0)
index d11869aa5db48e601c820e537fb01422075972e5..3908c100ccb27a5a7bd45ff8b507534c1eba540f 100644 (file)
@@ -296,8 +296,8 @@ lstcon_rpc_trans_abort(lstcon_rpc_trans_t *trans, int error)
 
                spin_lock(&rpc->crpc_lock);
 
-               if (!crpc->crp_posted || /* not posted */
-                   crpc->crp_stamp) { /* rpc done or aborted already */
+               if (!crpc->crp_posted ||        /* not posted */
+                   crpc->crp_stamp) {          /* rpc done or aborted already */
                        if (!crpc->crp_stamp) {
                                crpc->crp_stamp = cfs_time_current();
                                crpc->crp_status = -EINTR;
@@ -562,10 +562,10 @@ lstcon_rpc_trans_destroy(lstcon_rpc_trans_t *trans)
                }
 
                /*
-                * rpcs can be still not callbacked (even LNetMDUnlink is called)
-                * because huge timeout for inaccessible network, don't make
-                * user wait for them, just abandon them, they will be recycled
-                * in callback
+                * rpcs can be still not callbacked (even LNetMDUnlink is
+                * called) because huge timeout for inaccessible network,
+                * don't make user wait for them, just abandon them, they
+                * will be recycled in callback
                 */
                LASSERT(crpc->crp_status);
 
@@ -938,7 +938,7 @@ lstcon_sesnew_stat_reply(lstcon_rpc_trans_t *trans,
 
        if (!trans->tas_feats_updated) {
                spin_lock(&console_session.ses_rpc_lock);
-               if (!trans->tas_feats_updated) { /* recheck with lock */
+               if (!trans->tas_feats_updated) {        /* recheck with lock */
                        trans->tas_feats_updated = 1;
                        trans->tas_features = reply->msg_ses_feats;
                }
@@ -1178,7 +1178,8 @@ lstcon_rpc_pinger(void *arg)
        int count = 0;
        int rc;
 
-       /* RPC pinger is a special case of transaction,
+       /*
+        * RPC pinger is a special case of transaction,
         * it's called by timer at 8 seconds interval.
         */
        mutex_lock(&console_session.ses_mutex);
index 6ec895208c2667ddbe60d2ffddd1d68c13a52fea..dcfc83d0ad413f6d9ae9d5f4cd8873cc2d31449c 100644 (file)
@@ -277,7 +277,7 @@ lstcon_group_find(const char *name, lstcon_group_t **grpp)
                if (strncmp(grp->grp_name, name, LST_NAME_SIZE))
                        continue;
 
-               lstcon_group_addref(grp);  /* +1 ref for caller */
+               lstcon_group_addref(grp); /* +1 ref for caller */
                *grpp = grp;
                return 0;
        }
@@ -1446,7 +1446,8 @@ lstcon_test_batch_query(char *name, int testidx, int client,
 
        lstcon_rpc_trans_postwait(trans, timeout);
 
-       if (!testidx && /* query a batch, not a test */
+       /* query a batch, not a test */
+       if (!testidx &&
            !lstcon_rpc_stat_failure(lstcon_trans_stat(), 0) &&
            !lstcon_tsbqry_stat_run(lstcon_trans_stat(), 0)) {
                /* all RPCs finished, and no active test */
index 0f32f0be4edc924ed975fe1de462e09b0c6695fd..aa646a780f58779a3f31a653e9ce33b350222a65 100644 (file)
@@ -226,7 +226,7 @@ __must_hold(&sfw_data.fw_lock)
        }
 
        if (nactive)
-               return;   /* wait for active batches to stop */
+               return; /* wait for active batches to stop */
 
        list_del_init(&sn->sn_list);
        spin_unlock(&sfw_data.fw_lock);
@@ -693,7 +693,7 @@ sfw_unpack_addtest_req(srpc_msg_t *msg)
        LASSERT(req->tsr_is_client);
 
        if (msg->msg_magic == SRPC_MSG_MAGIC)
-               return; /* no flipping needed */
+               return; /* no flipping needed */
 
        LASSERT(msg->msg_magic == __swab32(SRPC_MSG_MAGIC));
 
@@ -789,7 +789,7 @@ sfw_add_test_instance(sfw_batch_t *tsb, struct srpc_server_rpc *rpc)
                int j;
 
                dests = page_address(bk->bk_iovs[i / SFW_ID_PER_PAGE].kiov_page);
-               LASSERT(dests);  /* my pages are within KVM always */
+               LASSERT(dests);         /* my pages are within KVM always */
                id = dests[i % SFW_ID_PER_PAGE];
                if (msg->msg_magic != SRPC_MSG_MAGIC)
                        sfw_unpack_id(id);
@@ -844,8 +844,8 @@ sfw_test_unit_done(sfw_test_unit_t *tsu)
 
        spin_lock(&sfw_data.fw_lock);
 
-       if (!atomic_dec_and_test(&tsb->bat_nactive) ||/* tsb still active */
-           sn == sfw_data.fw_session) {                  /* sn also active */
+       if (!atomic_dec_and_test(&tsb->bat_nactive) ||  /* tsb still active */
+           sn == sfw_data.fw_session) {                /* sn also active */
                spin_unlock(&sfw_data.fw_lock);
                return;
        }
@@ -1273,7 +1273,7 @@ sfw_handle_server_rpc(struct srpc_server_rpc *rpc)
                }
 
        } else if (request->msg_ses_feats & ~LST_FEATS_MASK) {
-               /**
+               /*
                 * NB: at this point, old version will ignore features and
                 * create new session anyway, so console should be able
                 * to handle this
index 438fca2e9b951906dcb71de13662b330b4632d94..c7c50be6dab4a3d1ee299c39c788b9b561292026 100644 (file)
@@ -129,7 +129,7 @@ ping_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
        LASSERT(sn);
 
        if (rpc->crpc_status) {
-               if (!tsi->tsi_stopping) /* rpc could have been aborted */
+               if (!tsi->tsi_stopping) /* rpc could have been aborted */
                        atomic_inc(&sn->sn_ping_errors);
                CERROR("Unable to ping %s (%d): %d\n",
                       libcfs_id2str(rpc->crpc_dest),
index 69be7d6f48fa9173ad3510fc56e4e4b9e45eb680..ab8ba37249540c2307f40029feb030b8814b46f8 100644 (file)
@@ -1332,8 +1332,8 @@ srpc_abort_rpc(srpc_client_rpc_t *rpc, int why)
 {
        LASSERT(why);
 
-       if (rpc->crpc_aborted || /* already aborted */
-           rpc->crpc_closed)    /* callback imminent */
+       if (rpc->crpc_aborted ||        /* already aborted */
+           rpc->crpc_closed)           /* callback imminent */
                return;
 
        CDEBUG(D_NET, "Aborting RPC: service %d, peer %s, state %s, why %d\n",
@@ -1401,7 +1401,7 @@ srpc_send_reply(struct srpc_server_rpc *rpc)
                                   rpc->srpc_peer, rpc->srpc_self,
                                   &rpc->srpc_replymdh, ev);
        if (rc)
-               ev->ev_fired = 1;  /* no more event expected */
+               ev->ev_fired = 1; /* no more event expected */
        return rc;
 }
 
@@ -1509,7 +1509,7 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
                        scd->scd_buf_err = 0;
                }
 
-               if (!scd->scd_buf_err && /* adding buffer is enabled */
+               if (!scd->scd_buf_err &&        /* adding buffer is enabled */
                    !scd->scd_buf_adjust &&
                    scd->scd_buf_nposted < scd->scd_buf_low) {
                        scd->scd_buf_adjust = max(scd->scd_buf_total / 2,
index ef8a8a748cbe9e0ec7289c0f6c3acccf39cc5a40..b6c4aae007af3e7294ca71bc2d458465f949c816 100644 (file)
@@ -49,7 +49,7 @@
  * sorted by increasing expiry time. The number of slots is 2**7 (128),
  * to cover a time period of 1024 seconds into the future before wrapping.
  */
-#define STTIMER_MINPOLL        3   /* log2 min poll interval (8 s) */
+#define STTIMER_MINPOLL        3       /* log2 min poll interval (8 s) */
 #define STTIMER_SLOTTIME       (1 << STTIMER_MINPOLL)
 #define STTIMER_SLOTTIMEMASK   (~(STTIMER_SLOTTIME - 1))
 #define STTIMER_NSLOTS        (1 << 7)