From 593fb6b5f46014e351416b62e0e24cf18f88b883 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Mon, 15 Jul 2024 05:07:11 -0400 Subject: [PATCH] LU-6142 lnet: Fix style issues for ping_test.c This patch fixes issues reported by checkpatch for file lnet/selftest/ping_test.c Test-Parameters: trivial testlist=sanity-lnet Signed-off-by: Arshad Hussain Change-Id: I828ce5ccf6bfc9868fc7a8f9fc9bcb8a9293d118 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55731 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Chris Horn Reviewed-by: Serguei Smirnov Reviewed-by: Oleg Drokin --- lnet/selftest/ping_test.c | 108 +++++++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/lnet/selftest/ping_test.c b/lnet/selftest/ping_test.c index 2d7f1ba5..4ec54d2 100644 --- a/lnet/selftest/ping_test.c +++ b/lnet/selftest/ping_test.c @@ -48,16 +48,16 @@ static void ping_client_fini(struct sfw_test_instance *tsi) { struct sfw_session *sn = tsi->tsi_batch->bat_session; - int errors; + int errors; - LASSERT (sn != NULL); - LASSERT (tsi->tsi_is_client); + LASSERT(sn != NULL); + LASSERT(tsi->tsi_is_client); errors = atomic_read(&sn->sn_ping_errors); - if (errors) - CWARN ("%d pings have failed.\n", errors); - else - CDEBUG (D_NET, "Ping test finished OK.\n"); + if (errors) + CWARN("%d pings have failed.\n", errors); + else + CDEBUG(D_NET, "Ping test finished OK.\n"); } static int @@ -74,12 +74,12 @@ ping_client_prep_rpc(struct sfw_test_unit *tsu, struct lnet_process_id dest, LASSERT((sn->sn_features & ~LST_FEATS_MASK) == 0); rc = sfw_create_test_rpc(tsu, dest, sn->sn_features, 0, 0, rpc); - if (rc != 0) - return rc; + if (rc != 0) + return rc; - req = &(*rpc)->crpc_reqstmsg.msg_body.ping_reqst; + req = &(*rpc)->crpc_reqstmsg.msg_body.ping_reqst; - req->pnr_magic = LST_PING_TEST_MAGIC; + req->pnr_magic = LST_PING_TEST_MAGIC; spin_lock(&lst_ping_data.pnd_lock); req->pnr_seq = lst_ping_data.pnd_counter++; @@ -103,38 +103,38 @@ ping_client_done_rpc(struct sfw_test_unit *tsu, struct srpc_client_rpc *rpc) LASSERT(sn != NULL); - if (rpc->crpc_status != 0) { - if (!tsi->tsi_stopping) /* rpc could have been aborted */ + if (rpc->crpc_status != 0) { + 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), - reqst->pnr_seq, rpc->crpc_status); - return; + CERROR("Unable to ping %s (%d): %d\n", + libcfs_id2str(rpc->crpc_dest), + reqst->pnr_seq, rpc->crpc_status); + return; } - if (rpc->crpc_replymsg.msg_magic != SRPC_MSG_MAGIC) { - __swab32s(&reply->pnr_seq); - __swab32s(&reply->pnr_magic); - __swab32s(&reply->pnr_status); - } + if (rpc->crpc_replymsg.msg_magic != SRPC_MSG_MAGIC) { + __swab32s(&reply->pnr_seq); + __swab32s(&reply->pnr_magic); + __swab32s(&reply->pnr_status); + } - if (reply->pnr_magic != LST_PING_TEST_MAGIC) { - rpc->crpc_status = -EBADMSG; + if (reply->pnr_magic != LST_PING_TEST_MAGIC) { + rpc->crpc_status = -EBADMSG; atomic_inc(&sn->sn_ping_errors); - CERROR ("Bad magic %u from %s, %u expected.\n", - reply->pnr_magic, libcfs_id2str(rpc->crpc_dest), - LST_PING_TEST_MAGIC); - return; + CERROR("Bad magic %u from %s, %u expected.\n", + reply->pnr_magic, libcfs_id2str(rpc->crpc_dest), + LST_PING_TEST_MAGIC); + return; } - if (reply->pnr_seq != reqst->pnr_seq) { - rpc->crpc_status = -EBADMSG; + if (reply->pnr_seq != reqst->pnr_seq) { + rpc->crpc_status = -EBADMSG; atomic_inc(&sn->sn_ping_errors); - CERROR ("Bad seq %u from %s, %u expected.\n", - reply->pnr_seq, libcfs_id2str(rpc->crpc_dest), - reqst->pnr_seq); - return; - } + CERROR("Bad seq %u from %s, %u expected.\n", + reply->pnr_seq, libcfs_id2str(rpc->crpc_dest), + reqst->pnr_seq); + return; + } ktime_get_real_ts64(&ts); CDEBUG(D_NET, "%d reply in %llu nsec\n", reply->pnr_seq, @@ -151,26 +151,26 @@ ping_server_handle(struct srpc_server_rpc *rpc) struct srpc_ping_reqst *req = &reqstmsg->msg_body.ping_reqst; struct srpc_ping_reply *rep = &rpc->srpc_replymsg.msg_body.ping_reply; - LASSERT (sv->sv_id == SRPC_SERVICE_PING); + LASSERT(sv->sv_id == SRPC_SERVICE_PING); - if (reqstmsg->msg_magic != SRPC_MSG_MAGIC) { - LASSERT (reqstmsg->msg_magic == __swab32(SRPC_MSG_MAGIC)); + if (reqstmsg->msg_magic != SRPC_MSG_MAGIC) { + LASSERT(reqstmsg->msg_magic == __swab32(SRPC_MSG_MAGIC)); - __swab32s(&req->pnr_seq); - __swab32s(&req->pnr_magic); - __swab64s(&req->pnr_time_sec); + __swab32s(&req->pnr_seq); + __swab32s(&req->pnr_magic); + __swab64s(&req->pnr_time_sec); __swab64s(&req->pnr_time_nsec); - } - LASSERT (reqstmsg->msg_type == srpc_service2request(sv->sv_id)); + } + LASSERT(reqstmsg->msg_type == srpc_service2request(sv->sv_id)); - if (req->pnr_magic != LST_PING_TEST_MAGIC) { - CERROR ("Unexpect magic %08x from %s\n", - req->pnr_magic, libcfs_id2str(rpc->srpc_peer)); - return -EINVAL; - } + if (req->pnr_magic != LST_PING_TEST_MAGIC) { + CERROR("Unexpect magic %08x from %s\n", + req->pnr_magic, libcfs_id2str(rpc->srpc_peer)); + return -EINVAL; + } - rep->pnr_seq = req->pnr_seq; - rep->pnr_magic = LST_PING_TEST_MAGIC; + rep->pnr_seq = req->pnr_seq; + rep->pnr_magic = LST_PING_TEST_MAGIC; if ((reqstmsg->msg_ses_feats & ~LST_FEATS_MASK) != 0) { replymsg->msg_ses_feats = LST_FEATS_MASK; @@ -189,10 +189,10 @@ struct sfw_test_client_ops ping_test_client; void ping_init_test_client(void) { - ping_test_client.tso_init = ping_client_init; - ping_test_client.tso_fini = ping_client_fini; - ping_test_client.tso_prep_rpc = ping_client_prep_rpc; - ping_test_client.tso_done_rpc = ping_client_done_rpc; + ping_test_client.tso_init = ping_client_init; + ping_test_client.tso_fini = ping_client_fini; + ping_test_client.tso_prep_rpc = ping_client_prep_rpc; + ping_test_client.tso_done_rpc = ping_client_done_rpc; } struct srpc_service ping_test_service; -- 1.8.3.1