staging: lustre: don't set more than one variable per line in LNet layer
authorJames Simmons <jsimmons@infradead.org>
Fri, 12 Feb 2016 17:06:05 +0000 (12:06 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Feb 2016 00:20:32 +0000 (16:20 -0800)
Cleanup all occurances of more than one variable being set per line as
reported by checkpatch.pl.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 files changed:
drivers/staging/lustre/include/linux/lnet/lib-lnet.h
drivers/staging/lustre/include/linux/lnet/socklnd.h
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
drivers/staging/lustre/lnet/lnet/config.c
drivers/staging/lustre/lnet/lnet/lib-md.c
drivers/staging/lustre/lnet/lnet/lib-move.c
drivers/staging/lustre/lnet/lnet/peer.c
drivers/staging/lustre/lnet/lnet/router.c
drivers/staging/lustre/lnet/selftest/conrpc.c
drivers/staging/lustre/lnet/selftest/selftest.h

index c3bf5e8a332408e57a2bea3ce6bc7f24dfca7082..b8be9b6c1c0383b4ef108a774a079d0d8ed9f2f8 100644 (file)
@@ -681,7 +681,8 @@ void lnet_debug_peer(lnet_nid_t nid);
 static inline void
 lnet_peer_set_alive(lnet_peer_t *lp)
 {
-       lp->lp_last_alive = lp->lp_last_query = jiffies;
+       lp->lp_last_query = jiffies;
+       lp->lp_last_alive = jiffies;
        if (!lp->lp_alive)
                lnet_notify_locked(lp, 0, 1, lp->lp_last_alive);
 }
index 3df5065b488dcd12d1f0e378d3cebe8765f94fe0..bc32403f4a087d4f3a8ffd1a44d7874016698898 100644 (file)
@@ -85,7 +85,8 @@ socklnd_init_msg(ksock_msg_t *msg, int type)
 {
        msg->ksm_csum = 0;
        msg->ksm_type = type;
-       msg->ksm_zc_cookies[0] = msg->ksm_zc_cookies[1]  = 0;
+       msg->ksm_zc_cookies[0] = 0;
+       msg->ksm_zc_cookies[1] = 0;
 }
 
 #define KSOCK_MSG_NOOP 0xC0    /* ksm_u empty */
index 812d9b53c64883271755c97bcb132e64ae2c41c3..db551e4d438299810f29ca42963fde48ccaec49d 100644 (file)
@@ -500,7 +500,8 @@ static int kiblnd_del_peer(lnet_ni_t *ni, lnet_nid_t nid)
        write_lock_irqsave(&kiblnd_data.kib_global_lock, flags);
 
        if (nid != LNET_NID_ANY) {
-               lo = hi = kiblnd_nid2peerlist(nid) - kiblnd_data.kib_peers;
+               lo = kiblnd_nid2peerlist(nid) - kiblnd_data.kib_peers;
+               hi = kiblnd_nid2peerlist(nid) - kiblnd_data.kib_peers;
        } else {
                lo = 0;
                hi = kiblnd_data.kib_peer_hash_size - 1;
@@ -979,9 +980,10 @@ static int kiblnd_close_matching_conns(lnet_ni_t *ni, lnet_nid_t nid)
 
        write_lock_irqsave(&kiblnd_data.kib_global_lock, flags);
 
-       if (nid != LNET_NID_ANY)
-               lo = hi = kiblnd_nid2peerlist(nid) - kiblnd_data.kib_peers;
-       else {
+       if (nid != LNET_NID_ANY) {
+               lo = kiblnd_nid2peerlist(nid) - kiblnd_data.kib_peers;
+               hi = kiblnd_nid2peerlist(nid) - kiblnd_data.kib_peers;
+       } else {
                lo = 0;
                hi = kiblnd_data.kib_peer_hash_size - 1;
        }
index 46d1810953118fa69c1896bdca4ed8028ee9f64d..14938c36174183401852e07efb3417996c1ae561 100644 (file)
@@ -1061,8 +1061,8 @@ kiblnd_init_rdma(kib_conn_t *conn, kib_tx_t *tx, int type,
        struct ib_sge *sge = &tx->tx_sge[0];
        struct ib_rdma_wr *wrq = &tx->tx_wrq[0], *next;
        int rc  = resid;
-       int srcidx;
-       int dstidx;
+       int srcidx = 0;
+       int dstidx = 0;
        int wrknob;
 
        LASSERT(!in_interrupt());
@@ -1070,8 +1070,6 @@ kiblnd_init_rdma(kib_conn_t *conn, kib_tx_t *tx, int type,
        LASSERT(type == IBLND_MSG_GET_DONE ||
                type == IBLND_MSG_PUT_DONE);
 
-       srcidx = dstidx = 0;
-
        while (resid > 0) {
                if (srcidx >= srcrd->rd_nfrags) {
                        CERROR("Src buffer exhausted: %d frags\n", srcidx);
index 4ab7f298f8e40d19fe61aa9946c28289fd4a8741..7c9525da0058d67dddf25b12b8a00ae64ac20678 100644 (file)
@@ -582,9 +582,10 @@ ksocknal_del_peer(lnet_ni_t *ni, lnet_process_id_t id, __u32 ip)
 
        write_lock_bh(&ksocknal_data.ksnd_global_lock);
 
-       if (id.nid != LNET_NID_ANY)
-               lo = hi = (int)(ksocknal_nid2peerlist(id.nid) - ksocknal_data.ksnd_peers);
-       else {
+       if (id.nid != LNET_NID_ANY) {
+               lo = (int)(ksocknal_nid2peerlist(id.nid) - ksocknal_data.ksnd_peers);
+               hi = (int)(ksocknal_nid2peerlist(id.nid) - ksocknal_data.ksnd_peers);
+       } else {
                lo = 0;
                hi = ksocknal_data.ksnd_peer_hash_size - 1;
        }
@@ -1774,9 +1775,10 @@ ksocknal_close_matching_conns(lnet_process_id_t id, __u32 ipaddr)
 
        write_lock_bh(&ksocknal_data.ksnd_global_lock);
 
-       if (id.nid != LNET_NID_ANY)
-               lo = hi = (int)(ksocknal_nid2peerlist(id.nid) - ksocknal_data.ksnd_peers);
-       else {
+       if (id.nid != LNET_NID_ANY) {
+               lo = (int)(ksocknal_nid2peerlist(id.nid) - ksocknal_data.ksnd_peers);
+               hi = (int)(ksocknal_nid2peerlist(id.nid) - ksocknal_data.ksnd_peers);
+       } else {
                lo = 0;
                hi = ksocknal_data.ksnd_peer_hash_size - 1;
        }
@@ -1938,7 +1940,8 @@ static int ksocknal_push(lnet_ni_t *ni, lnet_process_id_t id)
                start = &ksocknal_data.ksnd_peers[0];
                end = &ksocknal_data.ksnd_peers[hsize - 1];
        } else {
-               start = end = ksocknal_nid2peerlist(id.nid);
+               start = ksocknal_nid2peerlist(id.nid);
+               end = ksocknal_nid2peerlist(id.nid);
        }
 
        for (tmp = start; tmp <= end; tmp++) {
index 2fe23d434cc4187611e87e5fab21bc1390f26ad2..c59ddc250c591d63040d673db28beecbf5c7026e 100644 (file)
@@ -719,7 +719,8 @@ ksocknal_pack_msg_v1(ksock_tx_t *tx)
        tx->tx_iov[0].iov_base = &tx->tx_lnetmsg->msg_hdr;
        tx->tx_iov[0].iov_len  = sizeof(lnet_hdr_t);
 
-       tx->tx_resid = tx->tx_nob = tx->tx_lnetmsg->msg_len + sizeof(lnet_hdr_t);
+       tx->tx_nob = tx->tx_lnetmsg->msg_len + sizeof(lnet_hdr_t);
+       tx->tx_resid = tx->tx_lnetmsg->msg_len + sizeof(lnet_hdr_t);
 }
 
 static void
@@ -732,12 +733,14 @@ ksocknal_pack_msg_v2(ksock_tx_t *tx)
 
                tx->tx_msg.ksm_u.lnetmsg.ksnm_hdr = tx->tx_lnetmsg->msg_hdr;
                tx->tx_iov[0].iov_len = sizeof(ksock_msg_t);
-               tx->tx_resid = tx->tx_nob = sizeof(ksock_msg_t) + tx->tx_lnetmsg->msg_len;
+               tx->tx_nob = sizeof(ksock_msg_t) + tx->tx_lnetmsg->msg_len;
+               tx->tx_resid = sizeof(ksock_msg_t) + tx->tx_lnetmsg->msg_len;
        } else {
                LASSERT(tx->tx_msg.ksm_type == KSOCK_MSG_NOOP);
 
                tx->tx_iov[0].iov_len = offsetof(ksock_msg_t, ksm_u.lnetmsg.ksnm_hdr);
-               tx->tx_resid = tx->tx_nob = offsetof(ksock_msg_t,  ksm_u.lnetmsg.ksnm_hdr);
+               tx->tx_nob = offsetof(ksock_msg_t,  ksm_u.lnetmsg.ksnm_hdr);
+               tx->tx_resid = offsetof(ksock_msg_t,  ksm_u.lnetmsg.ksnm_hdr);
        }
        /* Don't checksum before start sending, because packet can be piggybacked with ACK */
 }
@@ -747,7 +750,8 @@ ksocknal_unpack_msg_v1(ksock_msg_t *msg)
 {
        msg->ksm_csum = 0;
        msg->ksm_type = KSOCK_MSG_LNET;
-       msg->ksm_zc_cookies[0] = msg->ksm_zc_cookies[1]  = 0;
+       msg->ksm_zc_cookies[0] = 0;
+       msg->ksm_zc_cookies[1] = 0;
 }
 
 static void
index e30a959ffc036acbc7f91140f2cf281df3cac90e..d02353dca85e01047bc46c80ff9ac3122644a6db 100644 (file)
@@ -202,7 +202,8 @@ lnet_parse_networks(struct list_head *nilist, char *networks)
        the_lnet.ln_network_tokens = tokens;
        the_lnet.ln_network_tokens_nob = tokensize;
        memcpy(tokens, networks, tokensize);
-       str = tmp = tokens;
+       tmp = tokens;
+       str = tokens;
 
        /* Add in the loopback network */
        ni = lnet_ni_alloc(LNET_MKNET(LOLND, 0), NULL, nilist);
index 4d59bac199f50736e5b752b05ec7c529a2a237e3..55bd7a1f7a5de0f0d4a7674ac3dcf2580f230b5a 100644 (file)
@@ -109,7 +109,8 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
                if ((umd->options & LNET_MD_KIOV) != 0) /* Can't specify both */
                        return -EINVAL;
 
-               lmd->md_niov = niov = umd->length;
+               niov = umd->length;
+               lmd->md_niov = umd->length;
                memcpy(lmd->md_iov.iov, umd->start,
                       niov * sizeof(lmd->md_iov.iov[0]));
 
@@ -130,7 +131,8 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
                        return -EINVAL;
 
        } else if ((umd->options & LNET_MD_KIOV) != 0) {
-               lmd->md_niov = niov = umd->length;
+               niov = umd->length;
+               lmd->md_niov = umd->length;
                memcpy(lmd->md_iov.kiov, umd->start,
                       niov * sizeof(lmd->md_iov.kiov[0]));
 
@@ -151,7 +153,8 @@ lnet_md_build(lnet_libmd_t *lmd, lnet_md_t *umd, int unlink)
                        return -EINVAL;
        } else {   /* contiguous */
                lmd->md_length = umd->length;
-               lmd->md_niov = niov = 1;
+               niov = 1;
+               lmd->md_niov = 1;
                lmd->md_iov.iov[0].iov_base = umd->start;
                lmd->md_iov.iov[0].iov_len = umd->length;
 
index 12bb983fd9912fa4ae9913c4a0f88cd489782ec6..b40220a5434cc255de174113c65d06a511dd5f33 100644 (file)
@@ -1151,7 +1151,8 @@ lnet_find_route_locked(lnet_ni_t *ni, lnet_nid_t target, lnet_nid_t rtr_nid)
                return NULL;
 
        lp_best = NULL;
-       rtr_best = rtr_last = NULL;
+       rtr_best = NULL;
+       rtr_last = NULL;
        list_for_each_entry(rtr, &rnet->lrn_routes, lr_list) {
                lp = rtr->lr_gateway;
 
@@ -1167,7 +1168,8 @@ lnet_find_route_locked(lnet_ni_t *ni, lnet_nid_t target, lnet_nid_t rtr_nid)
                        return lp;
 
                if (lp_best == NULL) {
-                       rtr_best = rtr_last = rtr;
+                       rtr_best = rtr;
+                       rtr_last = rtr;
                        lp_best = lp;
                        continue;
                }
@@ -1868,7 +1870,8 @@ lnet_parse(lnet_ni_t *ni, lnet_hdr_t *hdr, lnet_nid_t from_nid,
        msg->msg_type = type;
        msg->msg_private = private;
        msg->msg_receiving = 1;
-       msg->msg_len = msg->msg_wanted = payload_length;
+       msg->msg_wanted = payload_length;
+       msg->msg_len = payload_length;
        msg->msg_offset = 0;
        msg->msg_hdr = *hdr;
        /* for building message event */
index 9c0f264ae4cbb45cf7b8a4f4126486556d2742c8..a8e25b0d11b315a8a3bbe365275e3d332c9bff2c 100644 (file)
@@ -287,9 +287,9 @@ lnet_nid2peer_locked(lnet_peer_t **lpp, lnet_nid_t nid, int cpt)
                goto out;
        }
 
-       lp->lp_txcredits     =
-       lp->lp_mintxcredits  = lp->lp_ni->ni_peertxcredits;
-       lp->lp_rtrcredits    =
+       lp->lp_txcredits = lp->lp_ni->ni_peertxcredits;
+       lp->lp_mintxcredits = lp->lp_ni->ni_peertxcredits;
+       lp->lp_rtrcredits = lnet_peer_buffer_credits(lp->lp_ni);
        lp->lp_minrtrcredits = lnet_peer_buffer_credits(lp->lp_ni);
 
        list_add_tail(&lp->lp_hashlist,
index 65f951ca198b7949baaaa21e3061f3913147b274..36f3caabc2a679d5eeb9e4748c200b216f522487 100644 (file)
@@ -1307,7 +1307,8 @@ lnet_rtrpool_free_bufs(lnet_rtrbufpool_t *rbp)
        LASSERT(rbp->rbp_nbuffers == nbuffers);
        LASSERT(rbp->rbp_credits == nbuffers);
 
-       rbp->rbp_nbuffers = rbp->rbp_credits = 0;
+       rbp->rbp_nbuffers = 0;
+       rbp->rbp_credits = 0;
 }
 
 static int
index 3e702e234b33a2505d8e4c53898be982235f30d1..817be93a149d68f6c2e88328282a81990bba9d3c 100644 (file)
@@ -953,7 +953,8 @@ lstcon_sesnew_stat_reply(lstcon_rpc_trans_t *trans,
                CNETERR("Framework features %x from %s is different with features on this transaction: %x\n",
                        reply->msg_ses_feats, libcfs_nid2str(nd->nd_id.nid),
                        trans->tas_features);
-               status = mksn_rep->mksn_status = EPROTO;
+               mksn_rep->mksn_status = EPROTO;
+               status = EPROTO;
        }
 
        if (status == 0) {
index 870498339538be1ac5e3c24702e72a1c01459031..5781f7766f2dcdf0d28417acf75e12afd3de3720 100644 (file)
@@ -546,8 +546,8 @@ srpc_init_client_rpc (srpc_client_rpc_t *rpc, lnet_process_id_t peer,
        LNetInvalidateHandle(&rpc->crpc_bulk.bk_mdh);
 
        /* no event is expected at this point */
-       rpc->crpc_bulkev.ev_fired  =
-       rpc->crpc_reqstev.ev_fired =
+       rpc->crpc_bulkev.ev_fired = 1;
+       rpc->crpc_reqstev.ev_fired = 1;
        rpc->crpc_replyev.ev_fired = 1;
 
        rpc->crpc_reqstmsg.msg_magic   = SRPC_MSG_MAGIC;