All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] Cleanup and audit of lnet selftest code
@ 2016-03-12  1:29 ` James Simmons
  0 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

With lnet selftest nearly in sync with the OpenSFS code base it
was time to do a audit to see if anything was missed. One patch
was missed a few errors unique to upstream needed to be addressed.
Besides adding in fixes it was time to do more kernel style
cleanups. In the process several more checkpatch issues were
addressed.

Isaac Huang (1):
  staging: lustre: fix bogus lst errors for lnet selftest

James Simmons (9):
  staging: lustre: remove returns in void function for lnet selftest
  staging: lustre: fix spacing issues checkpatch reported in lnet selftest
  staging: lustre: remove extra spacing of variable declartions for lnet selftest
  staging: lustre: remove extra spacing when setting variable for lnet selftest
  staging: lustre: filter remaining extra spacing for lnet selftest
  staging: lustre: cleanup comment style for lnet selftest
  staging: lustre: test for proper errno code in lstcon_rpc_trans_abort
  staging: lustre: report minimum of two buffers for LNet selftest load test
  staging: lustre: fix aligments in lnet selftest

 drivers/staging/lustre/lnet/selftest/brw_test.c  |   97 ++++----
 drivers/staging/lustre/lnet/selftest/conctl.c    |  106 ++++----
 drivers/staging/lustre/lnet/selftest/conrpc.c    |  148 ++++++------
 drivers/staging/lustre/lnet/selftest/conrpc.h    |   56 +++---
 drivers/staging/lustre/lnet/selftest/console.c   |  140 ++++++------
 drivers/staging/lustre/lnet/selftest/console.h   |  116 +++++-----
 drivers/staging/lustre/lnet/selftest/framework.c |  187 +++++++--------
 drivers/staging/lustre/lnet/selftest/module.c    |    5 +-
 drivers/staging/lustre/lnet/selftest/ping_test.c |   21 +-
 drivers/staging/lustre/lnet/selftest/rpc.c       |  143 ++++++------
 drivers/staging/lustre/lnet/selftest/rpc.h       |  180 +++++++-------
 drivers/staging/lustre/lnet/selftest/selftest.h  |  278 +++++++++++-----------
 drivers/staging/lustre/lnet/selftest/timer.c     |   14 +-
 drivers/staging/lustre/lnet/selftest/timer.h     |    6 +-
 14 files changed, 735 insertions(+), 762 deletions(-)

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 00/10] Cleanup and audit of lnet selftest code
@ 2016-03-12  1:29 ` James Simmons
  0 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

With lnet selftest nearly in sync with the OpenSFS code base it
was time to do a audit to see if anything was missed. One patch
was missed a few errors unique to upstream needed to be addressed.
Besides adding in fixes it was time to do more kernel style
cleanups. In the process several more checkpatch issues were
addressed.

Isaac Huang (1):
  staging: lustre: fix bogus lst errors for lnet selftest

James Simmons (9):
  staging: lustre: remove returns in void function for lnet selftest
  staging: lustre: fix spacing issues checkpatch reported in lnet selftest
  staging: lustre: remove extra spacing of variable declartions for lnet selftest
  staging: lustre: remove extra spacing when setting variable for lnet selftest
  staging: lustre: filter remaining extra spacing for lnet selftest
  staging: lustre: cleanup comment style for lnet selftest
  staging: lustre: test for proper errno code in lstcon_rpc_trans_abort
  staging: lustre: report minimum of two buffers for LNet selftest load test
  staging: lustre: fix aligments in lnet selftest

 drivers/staging/lustre/lnet/selftest/brw_test.c  |   97 ++++----
 drivers/staging/lustre/lnet/selftest/conctl.c    |  106 ++++----
 drivers/staging/lustre/lnet/selftest/conrpc.c    |  148 ++++++------
 drivers/staging/lustre/lnet/selftest/conrpc.h    |   56 +++---
 drivers/staging/lustre/lnet/selftest/console.c   |  140 ++++++------
 drivers/staging/lustre/lnet/selftest/console.h   |  116 +++++-----
 drivers/staging/lustre/lnet/selftest/framework.c |  187 +++++++--------
 drivers/staging/lustre/lnet/selftest/module.c    |    5 +-
 drivers/staging/lustre/lnet/selftest/ping_test.c |   21 +-
 drivers/staging/lustre/lnet/selftest/rpc.c       |  143 ++++++------
 drivers/staging/lustre/lnet/selftest/rpc.h       |  180 +++++++-------
 drivers/staging/lustre/lnet/selftest/selftest.h  |  278 +++++++++++-----------
 drivers/staging/lustre/lnet/selftest/timer.c     |   14 +-
 drivers/staging/lustre/lnet/selftest/timer.h     |    6 +-
 14 files changed, 735 insertions(+), 762 deletions(-)

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 01/10] staging: lustre: fix bogus lst errors for lnet selftest
  2016-03-12  1:29 ` [lustre-devel] " James Simmons
@ 2016-03-12  1:29   ` James Simmons
  -1 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, Isaac Huang

From: Isaac Huang <he.huang@intel.com>

It should not be counted as errors if a test RPC
has been stopped due to administrative actions,
e.g. lst end_session from the remote test console.

Signed-off-by: Isaac Huang <he.huang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4181
Reviewed-on: http://review.whamcloud.com/13279
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
---
 drivers/staging/lustre/lnet/selftest/rpc.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index 5eb4232..60d38df 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -1427,9 +1427,16 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
 	LASSERT(!in_interrupt());
 
 	if (ev->status) {
+		__u32 errors;
+
 		spin_lock(&srpc_data.rpc_glock);
-		srpc_data.rpc_counters.errors++;
+		if (ev->status != -ECANCELED) /* cancellation is not error */
+			srpc_data.rpc_counters.errors++;
+		errors = srpc_data.rpc_counters.errors;
 		spin_unlock(&srpc_data.rpc_glock);
+
+		CNETERR("LNet event status %d type %d, RPC errors %u\n",
+			ev->status, ev->type, errors);
 	}
 
 	rpcev->ev_lnet = ev->type;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 01/10] staging: lustre: fix bogus lst errors for lnet selftest
@ 2016-03-12  1:29   ` James Simmons
  0 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, Isaac Huang

From: Isaac Huang <he.huang@intel.com>

It should not be counted as errors if a test RPC
has been stopped due to administrative actions,
e.g. lst end_session from the remote test console.

Signed-off-by: Isaac Huang <he.huang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4181
Reviewed-on: http://review.whamcloud.com/13279
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
---
 drivers/staging/lustre/lnet/selftest/rpc.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index 5eb4232..60d38df 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -1427,9 +1427,16 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
 	LASSERT(!in_interrupt());
 
 	if (ev->status) {
+		__u32 errors;
+
 		spin_lock(&srpc_data.rpc_glock);
-		srpc_data.rpc_counters.errors++;
+		if (ev->status != -ECANCELED) /* cancellation is not error */
+			srpc_data.rpc_counters.errors++;
+		errors = srpc_data.rpc_counters.errors;
 		spin_unlock(&srpc_data.rpc_glock);
+
+		CNETERR("LNet event status %d type %d, RPC errors %u\n",
+			ev->status, ev->type, errors);
 	}
 
 	rpcev->ev_lnet = ev->type;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 02/10] staging: lustre: remove returns in void function for lnet selftest
  2016-03-12  1:29 ` [lustre-devel] " James Simmons
@ 2016-03-12  1:29   ` James Simmons
  -1 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

No reason to have returns at end of void function.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/brw_test.c  |    9 +++------
 drivers/staging/lustre/lnet/selftest/conrpc.c    |    6 ------
 drivers/staging/lustre/lnet/selftest/framework.c |   14 --------------
 drivers/staging/lustre/lnet/selftest/ping_test.c |    1 -
 drivers/staging/lustre/lnet/selftest/rpc.c       |    8 --------
 drivers/staging/lustre/lnet/selftest/selftest.h  |    3 ---
 6 files changed, 3 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c
index b71f4b4..7bfc0db 100644
--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -331,7 +331,7 @@ brw_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
 		       libcfs_id2str(rpc->crpc_dest), rpc->crpc_status);
 		if (!tsi->tsi_stopping) /* rpc could have been aborted */
 			atomic_inc(&sn->sn_brw_errors);
-		goto out;
+		return;
 	}
 
 	if (msg->msg_magic != SRPC_MSG_MAGIC) {
@@ -346,11 +346,11 @@ brw_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
 	if (reply->brw_status) {
 		atomic_inc(&sn->sn_brw_errors);
 		rpc->crpc_status = -(int)reply->brw_status;
-		goto out;
+		return;
 	}
 
 	if (reqst->brw_rw == LST_BRW_WRITE)
-		goto out;
+		return;
 
 	if (brw_check_bulk(&rpc->crpc_bulk, reqst->brw_flags, magic)) {
 		CERROR("Bulk data from %s is corrupted!\n",
@@ -358,9 +358,6 @@ brw_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
 		atomic_inc(&sn->sn_brw_errors);
 		rpc->crpc_status = -EBADMSG;
 	}
-
-out:
-	return;
 }
 
 static void
diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index 5604fce..f2afa13 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -463,8 +463,6 @@ lstcon_rpc_trans_stat(lstcon_rpc_trans_t *trans, lstcon_trans_stat_t *stat)
 	       lstcon_rpc_stat_failure(stat, 0),
 	       lstcon_rpc_stat_total(stat, 0),
 	       stat->trs_rpc_errno, stat->trs_fwk_errno);
-
-	return;
 }
 
 int
@@ -593,8 +591,6 @@ lstcon_rpc_trans_destroy(lstcon_rpc_trans_t *trans)
 	       lstcon_rpc_trans_name(trans->tas_opc), count);
 
 	LIBCFS_FREE(trans, sizeof(*trans));
-
-	return;
 }
 
 int
@@ -1084,8 +1080,6 @@ lstcon_rpc_stat_reply(lstcon_rpc_trans_t *trans, srpc_msg_t *msg,
 
 	if (!stat->trs_fwk_errno)
 		stat->trs_fwk_errno = rc;
-
-	return;
 }
 
 int
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index b86db8d..04bab32 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -172,7 +172,6 @@ sfw_add_session_timer(void)
 	sn->sn_timer_active = 1;
 	timer->stt_expires = ktime_get_real_seconds() + sn->sn_timeout;
 	stt_add_timer(timer);
-	return;
 }
 
 static int
@@ -296,7 +295,6 @@ sfw_server_rpc_done(struct srpc_server_rpc *rpc)
 
 	if (rpc->srpc_bulk)
 		sfw_free_pages(rpc);
-	return;
 }
 
 static void
@@ -613,7 +611,6 @@ sfw_unload_test(struct sfw_test_instance *tsi)
 	 */
 	srpc_service_remove_buffers(tsc->tsc_srv_service,
 				    sfw_test_buffers(tsi));
-	return;
 }
 
 static void
@@ -648,7 +645,6 @@ sfw_destroy_test_instance(sfw_test_instance_t *tsi)
 clean:
 	sfw_unload_test(tsi);
 	LIBCFS_FREE(tsi, sizeof(*tsi));
-	return;
 }
 
 static void
@@ -667,7 +663,6 @@ sfw_destroy_batch(sfw_batch_t *tsb)
 	}
 
 	LIBCFS_FREE(tsb, sizeof(sfw_batch_t));
-	return;
 }
 
 void
@@ -687,7 +682,6 @@ sfw_destroy_session(sfw_session_t *sn)
 
 	LIBCFS_FREE(sn, sizeof(*sn));
 	atomic_dec(&sfw_data.fw_nzombies);
-	return;
 }
 
 static void
@@ -732,7 +726,6 @@ sfw_unpack_addtest_req(srpc_msg_t *msg)
 	}
 
 	LBUG();
-	return;
 }
 
 static int
@@ -870,7 +863,6 @@ sfw_test_unit_done(sfw_test_unit_t *tsu)
 	spin_unlock(&sfw_data.fw_lock);
 
 	sfw_destroy_session(sn);
-	return;
 }
 
 static void
@@ -905,7 +897,6 @@ sfw_test_rpc_done(srpc_client_rpc_t *rpc)
 	}
 
 	sfw_test_unit_done(tsu);
-	return;
 }
 
 int
@@ -1565,7 +1556,6 @@ sfw_unpack_message(srpc_msg_t *msg)
 	}
 
 	LBUG();
-	return;
 }
 
 void
@@ -1577,7 +1567,6 @@ sfw_abort_rpc(srpc_client_rpc_t *rpc)
 	spin_lock(&rpc->crpc_lock);
 	srpc_abort_rpc(rpc, -EINTR);
 	spin_unlock(&rpc->crpc_lock);
-	return;
 }
 
 void
@@ -1594,7 +1583,6 @@ sfw_post_rpc(srpc_client_rpc_t *rpc)
 	srpc_post_rpc(rpc);
 
 	spin_unlock(&rpc->crpc_lock);
-	return;
 }
 
 static srpc_service_t sfw_services[] = {
@@ -1798,6 +1786,4 @@ sfw_shutdown(void)
 		list_del(&tsc->tsc_list);
 		LIBCFS_FREE(tsc, sizeof(*tsc));
 	}
-
-	return;
 }
diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c b/drivers/staging/lustre/lnet/selftest/ping_test.c
index 6d44126..33c758a 100644
--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
@@ -165,7 +165,6 @@ ping_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
 	CDEBUG(D_NET, "%d reply in %u usec\n", reply->pnr_seq,
 	       (unsigned)((ts.tv_sec - reqst->pnr_time_sec) * 1000000 +
 			  (ts.tv_nsec / NSEC_PER_USEC - reqst->pnr_time_usec)));
-	return;
 }
 
 static int
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index 60d38df..08a0ad5 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -118,7 +118,6 @@ srpc_free_bulk(srpc_bulk_t *bk)
 	}
 
 	LIBCFS_FREE(bk, offsetof(srpc_bulk_t, bk_iovs[bk->bk_niov]));
-	return;
 }
 
 srpc_bulk_t *
@@ -960,7 +959,6 @@ srpc_server_rpc_done(struct srpc_server_rpc *rpc, int status)
 	}
 
 	spin_unlock(&scd->scd_lock);
-	return;
 }
 
 /* handles an incoming RPC */
@@ -1110,7 +1108,6 @@ srpc_add_client_rpc_timer(srpc_client_rpc_t *rpc)
 	timer->stt_func    = srpc_client_rpc_expired;
 	timer->stt_expires = ktime_get_real_seconds() + rpc->crpc_timeout;
 	stt_add_timer(timer);
-	return;
 }
 
 /*
@@ -1174,7 +1171,6 @@ srpc_client_rpc_done(srpc_client_rpc_t *rpc, int status)
 	spin_unlock(&rpc->crpc_lock);
 
 	(*rpc->crpc_done)(rpc);
-	return;
 }
 
 /* sends an outgoing RPC */
@@ -1347,7 +1343,6 @@ srpc_abort_rpc(srpc_client_rpc_t *rpc, int why)
 	rpc->crpc_aborted = 1;
 	rpc->crpc_status  = why;
 	swi_schedule_workitem(&rpc->crpc_wi);
-	return;
 }
 
 /* called with rpc->crpc_lock held */
@@ -1363,7 +1358,6 @@ srpc_post_rpc(srpc_client_rpc_t *rpc)
 
 	srpc_add_client_rpc_timer(rpc);
 	swi_schedule_workitem(&rpc->crpc_wi);
-	return;
 }
 
 int
@@ -1689,6 +1683,4 @@ srpc_shutdown(void)
 	case SRPC_STATE_NI_INIT:
 		LNetNIFini();
 	}
-
-	return;
 }
diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h
index 4ca274f..9669088 100644
--- a/drivers/staging/lustre/lnet/selftest/selftest.h
+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
@@ -512,8 +512,6 @@ srpc_destroy_client_rpc(srpc_client_rpc_t *rpc)
 		LIBCFS_FREE(rpc, srpc_client_rpc_size(rpc));
 	else
 		(*rpc->crpc_fini) (rpc);
-
-	return;
 }
 
 static inline void
@@ -552,7 +550,6 @@ srpc_init_client_rpc(srpc_client_rpc_t *rpc, lnet_process_id_t peer,
 	rpc->crpc_reqstmsg.msg_magic   = SRPC_MSG_MAGIC;
 	rpc->crpc_reqstmsg.msg_version = SRPC_MSG_VERSION;
 	rpc->crpc_reqstmsg.msg_type    = srpc_service2request(service);
-	return;
 }
 
 static inline const char *
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 02/10] staging: lustre: remove returns in void function for lnet selftest
@ 2016-03-12  1:29   ` James Simmons
  0 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

No reason to have returns at end of void function.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/brw_test.c  |    9 +++------
 drivers/staging/lustre/lnet/selftest/conrpc.c    |    6 ------
 drivers/staging/lustre/lnet/selftest/framework.c |   14 --------------
 drivers/staging/lustre/lnet/selftest/ping_test.c |    1 -
 drivers/staging/lustre/lnet/selftest/rpc.c       |    8 --------
 drivers/staging/lustre/lnet/selftest/selftest.h  |    3 ---
 6 files changed, 3 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c
index b71f4b4..7bfc0db 100644
--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -331,7 +331,7 @@ brw_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
 		       libcfs_id2str(rpc->crpc_dest), rpc->crpc_status);
 		if (!tsi->tsi_stopping) /* rpc could have been aborted */
 			atomic_inc(&sn->sn_brw_errors);
-		goto out;
+		return;
 	}
 
 	if (msg->msg_magic != SRPC_MSG_MAGIC) {
@@ -346,11 +346,11 @@ brw_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
 	if (reply->brw_status) {
 		atomic_inc(&sn->sn_brw_errors);
 		rpc->crpc_status = -(int)reply->brw_status;
-		goto out;
+		return;
 	}
 
 	if (reqst->brw_rw == LST_BRW_WRITE)
-		goto out;
+		return;
 
 	if (brw_check_bulk(&rpc->crpc_bulk, reqst->brw_flags, magic)) {
 		CERROR("Bulk data from %s is corrupted!\n",
@@ -358,9 +358,6 @@ brw_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
 		atomic_inc(&sn->sn_brw_errors);
 		rpc->crpc_status = -EBADMSG;
 	}
-
-out:
-	return;
 }
 
 static void
diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index 5604fce..f2afa13 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -463,8 +463,6 @@ lstcon_rpc_trans_stat(lstcon_rpc_trans_t *trans, lstcon_trans_stat_t *stat)
 	       lstcon_rpc_stat_failure(stat, 0),
 	       lstcon_rpc_stat_total(stat, 0),
 	       stat->trs_rpc_errno, stat->trs_fwk_errno);
-
-	return;
 }
 
 int
@@ -593,8 +591,6 @@ lstcon_rpc_trans_destroy(lstcon_rpc_trans_t *trans)
 	       lstcon_rpc_trans_name(trans->tas_opc), count);
 
 	LIBCFS_FREE(trans, sizeof(*trans));
-
-	return;
 }
 
 int
@@ -1084,8 +1080,6 @@ lstcon_rpc_stat_reply(lstcon_rpc_trans_t *trans, srpc_msg_t *msg,
 
 	if (!stat->trs_fwk_errno)
 		stat->trs_fwk_errno = rc;
-
-	return;
 }
 
 int
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index b86db8d..04bab32 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -172,7 +172,6 @@ sfw_add_session_timer(void)
 	sn->sn_timer_active = 1;
 	timer->stt_expires = ktime_get_real_seconds() + sn->sn_timeout;
 	stt_add_timer(timer);
-	return;
 }
 
 static int
@@ -296,7 +295,6 @@ sfw_server_rpc_done(struct srpc_server_rpc *rpc)
 
 	if (rpc->srpc_bulk)
 		sfw_free_pages(rpc);
-	return;
 }
 
 static void
@@ -613,7 +611,6 @@ sfw_unload_test(struct sfw_test_instance *tsi)
 	 */
 	srpc_service_remove_buffers(tsc->tsc_srv_service,
 				    sfw_test_buffers(tsi));
-	return;
 }
 
 static void
@@ -648,7 +645,6 @@ sfw_destroy_test_instance(sfw_test_instance_t *tsi)
 clean:
 	sfw_unload_test(tsi);
 	LIBCFS_FREE(tsi, sizeof(*tsi));
-	return;
 }
 
 static void
@@ -667,7 +663,6 @@ sfw_destroy_batch(sfw_batch_t *tsb)
 	}
 
 	LIBCFS_FREE(tsb, sizeof(sfw_batch_t));
-	return;
 }
 
 void
@@ -687,7 +682,6 @@ sfw_destroy_session(sfw_session_t *sn)
 
 	LIBCFS_FREE(sn, sizeof(*sn));
 	atomic_dec(&sfw_data.fw_nzombies);
-	return;
 }
 
 static void
@@ -732,7 +726,6 @@ sfw_unpack_addtest_req(srpc_msg_t *msg)
 	}
 
 	LBUG();
-	return;
 }
 
 static int
@@ -870,7 +863,6 @@ sfw_test_unit_done(sfw_test_unit_t *tsu)
 	spin_unlock(&sfw_data.fw_lock);
 
 	sfw_destroy_session(sn);
-	return;
 }
 
 static void
@@ -905,7 +897,6 @@ sfw_test_rpc_done(srpc_client_rpc_t *rpc)
 	}
 
 	sfw_test_unit_done(tsu);
-	return;
 }
 
 int
@@ -1565,7 +1556,6 @@ sfw_unpack_message(srpc_msg_t *msg)
 	}
 
 	LBUG();
-	return;
 }
 
 void
@@ -1577,7 +1567,6 @@ sfw_abort_rpc(srpc_client_rpc_t *rpc)
 	spin_lock(&rpc->crpc_lock);
 	srpc_abort_rpc(rpc, -EINTR);
 	spin_unlock(&rpc->crpc_lock);
-	return;
 }
 
 void
@@ -1594,7 +1583,6 @@ sfw_post_rpc(srpc_client_rpc_t *rpc)
 	srpc_post_rpc(rpc);
 
 	spin_unlock(&rpc->crpc_lock);
-	return;
 }
 
 static srpc_service_t sfw_services[] = {
@@ -1798,6 +1786,4 @@ sfw_shutdown(void)
 		list_del(&tsc->tsc_list);
 		LIBCFS_FREE(tsc, sizeof(*tsc));
 	}
-
-	return;
 }
diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c b/drivers/staging/lustre/lnet/selftest/ping_test.c
index 6d44126..33c758a 100644
--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
@@ -165,7 +165,6 @@ ping_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
 	CDEBUG(D_NET, "%d reply in %u usec\n", reply->pnr_seq,
 	       (unsigned)((ts.tv_sec - reqst->pnr_time_sec) * 1000000 +
 			  (ts.tv_nsec / NSEC_PER_USEC - reqst->pnr_time_usec)));
-	return;
 }
 
 static int
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index 60d38df..08a0ad5 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -118,7 +118,6 @@ srpc_free_bulk(srpc_bulk_t *bk)
 	}
 
 	LIBCFS_FREE(bk, offsetof(srpc_bulk_t, bk_iovs[bk->bk_niov]));
-	return;
 }
 
 srpc_bulk_t *
@@ -960,7 +959,6 @@ srpc_server_rpc_done(struct srpc_server_rpc *rpc, int status)
 	}
 
 	spin_unlock(&scd->scd_lock);
-	return;
 }
 
 /* handles an incoming RPC */
@@ -1110,7 +1108,6 @@ srpc_add_client_rpc_timer(srpc_client_rpc_t *rpc)
 	timer->stt_func    = srpc_client_rpc_expired;
 	timer->stt_expires = ktime_get_real_seconds() + rpc->crpc_timeout;
 	stt_add_timer(timer);
-	return;
 }
 
 /*
@@ -1174,7 +1171,6 @@ srpc_client_rpc_done(srpc_client_rpc_t *rpc, int status)
 	spin_unlock(&rpc->crpc_lock);
 
 	(*rpc->crpc_done)(rpc);
-	return;
 }
 
 /* sends an outgoing RPC */
@@ -1347,7 +1343,6 @@ srpc_abort_rpc(srpc_client_rpc_t *rpc, int why)
 	rpc->crpc_aborted = 1;
 	rpc->crpc_status  = why;
 	swi_schedule_workitem(&rpc->crpc_wi);
-	return;
 }
 
 /* called with rpc->crpc_lock held */
@@ -1363,7 +1358,6 @@ srpc_post_rpc(srpc_client_rpc_t *rpc)
 
 	srpc_add_client_rpc_timer(rpc);
 	swi_schedule_workitem(&rpc->crpc_wi);
-	return;
 }
 
 int
@@ -1689,6 +1683,4 @@ srpc_shutdown(void)
 	case SRPC_STATE_NI_INIT:
 		LNetNIFini();
 	}
-
-	return;
 }
diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h
index 4ca274f..9669088 100644
--- a/drivers/staging/lustre/lnet/selftest/selftest.h
+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
@@ -512,8 +512,6 @@ srpc_destroy_client_rpc(srpc_client_rpc_t *rpc)
 		LIBCFS_FREE(rpc, srpc_client_rpc_size(rpc));
 	else
 		(*rpc->crpc_fini) (rpc);
-
-	return;
 }
 
 static inline void
@@ -552,7 +550,6 @@ srpc_init_client_rpc(srpc_client_rpc_t *rpc, lnet_process_id_t peer,
 	rpc->crpc_reqstmsg.msg_magic   = SRPC_MSG_MAGIC;
 	rpc->crpc_reqstmsg.msg_version = SRPC_MSG_VERSION;
 	rpc->crpc_reqstmsg.msg_type    = srpc_service2request(service);
-	return;
 }
 
 static inline const char *
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 03/10] staging: lustre: fix spacing issues checkpatch reported in lnet selftest
  2016-03-12  1:29 ` [lustre-devel] " James Simmons
@ 2016-03-12  1:29   ` James Simmons
  -1 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

Remove any extra spacing as reported by checkpatch.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/brw_test.c |    6 +++---
 drivers/staging/lustre/lnet/selftest/console.c  |    6 +++---
 drivers/staging/lustre/lnet/selftest/selftest.h |    2 +-
 drivers/staging/lustre/lnet/selftest/timer.h    |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c
index 7bfc0db..18c7422 100644
--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -194,12 +194,12 @@ brw_check_page(struct page *pg, int pattern, __u64 magic)
 		return 0;
 
 	if (pattern == LST_BRW_CHECK_SIMPLE) {
-		data = *((__u64 *) addr);
+		data = *((__u64 *)addr);
 		if (data != magic)
 			goto bad_data;
 
 		addr += PAGE_CACHE_SIZE - BRW_MSIZE;
-		data = *((__u64 *) addr);
+		data = *((__u64 *)addr);
 		if (data != magic)
 			goto bad_data;
 
@@ -208,7 +208,7 @@ brw_check_page(struct page *pg, int pattern, __u64 magic)
 
 	if (pattern == LST_BRW_CHECK_FULL) {
 		for (i = 0; i < PAGE_CACHE_SIZE / BRW_MSIZE; i++) {
-			data = *(((__u64 *) addr) + i);
+			data = *(((__u64 *)addr) + i);
 			if (data != magic)
 				goto bad_data;
 		}
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index 9f1838f..b0c9acd 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -207,7 +207,7 @@ lstcon_group_alloc(char *name, lstcon_group_t **grpp)
 
 	grp->grp_ref = 1;
 	if (name) {
-		if (strlen(name) > sizeof(grp->grp_name)-1) {
+		if (strlen(name) > sizeof(grp->grp_name) - 1) {
 			LIBCFS_FREE(grp, offsetof(lstcon_group_t,
 				    grp_ndl_hash[LST_NODE_HASHSIZE]));
 			return -E2BIG;
@@ -525,7 +525,7 @@ lstcon_group_add(char *name)
 	lstcon_group_t *grp;
 	int rc;
 
-	rc = lstcon_group_find(name, &grp) ? 0: -EEXIST;
+	rc = lstcon_group_find(name, &grp) ? 0 : -EEXIST;
 	if (rc) {
 		/* find a group with same name */
 		lstcon_group_decref(grp);
@@ -1746,7 +1746,7 @@ lstcon_session_new(char *name, int key, unsigned feats,
 	console_session.ses_timeout = (timeout <= 0) ?
 				      LST_CONSOLE_TIMEOUT : timeout;
 
-	if (strlen(name) > sizeof(console_session.ses_name)-1)
+	if (strlen(name) > sizeof(console_session.ses_name) - 1)
 		return -E2BIG;
 	strncpy(console_session.ses_name, name,
 		sizeof(console_session.ses_name));
diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h
index 9669088..b605f7f 100644
--- a/drivers/staging/lustre/lnet/selftest/selftest.h
+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
@@ -415,7 +415,7 @@ typedef struct sfw_test_case {
 srpc_client_rpc_t *
 sfw_create_rpc(lnet_process_id_t peer, int service,
 	       unsigned features, int nbulkiov, int bulklen,
-	       void (*done) (srpc_client_rpc_t *), void *priv);
+	       void (*done)(srpc_client_rpc_t *), void *priv);
 int sfw_create_test_rpc(sfw_test_unit_t *tsu,
 			lnet_process_id_t peer, unsigned features,
 			int nblk, int blklen, srpc_client_rpc_t **rpc);
diff --git a/drivers/staging/lustre/lnet/selftest/timer.h b/drivers/staging/lustre/lnet/selftest/timer.h
index 2affecf..39327bb 100644
--- a/drivers/staging/lustre/lnet/selftest/timer.h
+++ b/drivers/staging/lustre/lnet/selftest/timer.h
@@ -41,7 +41,7 @@
 struct stt_timer {
 	struct list_head stt_list;
 	time64_t         stt_expires;
-	void             (*stt_func) (void *);
+	void             (*stt_func)(void *);
 	void             *stt_data;
 };
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 03/10] staging: lustre: fix spacing issues checkpatch reported in lnet selftest
@ 2016-03-12  1:29   ` James Simmons
  0 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

Remove any extra spacing as reported by checkpatch.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/brw_test.c |    6 +++---
 drivers/staging/lustre/lnet/selftest/console.c  |    6 +++---
 drivers/staging/lustre/lnet/selftest/selftest.h |    2 +-
 drivers/staging/lustre/lnet/selftest/timer.h    |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c
index 7bfc0db..18c7422 100644
--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -194,12 +194,12 @@ brw_check_page(struct page *pg, int pattern, __u64 magic)
 		return 0;
 
 	if (pattern == LST_BRW_CHECK_SIMPLE) {
-		data = *((__u64 *) addr);
+		data = *((__u64 *)addr);
 		if (data != magic)
 			goto bad_data;
 
 		addr += PAGE_CACHE_SIZE - BRW_MSIZE;
-		data = *((__u64 *) addr);
+		data = *((__u64 *)addr);
 		if (data != magic)
 			goto bad_data;
 
@@ -208,7 +208,7 @@ brw_check_page(struct page *pg, int pattern, __u64 magic)
 
 	if (pattern == LST_BRW_CHECK_FULL) {
 		for (i = 0; i < PAGE_CACHE_SIZE / BRW_MSIZE; i++) {
-			data = *(((__u64 *) addr) + i);
+			data = *(((__u64 *)addr) + i);
 			if (data != magic)
 				goto bad_data;
 		}
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index 9f1838f..b0c9acd 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -207,7 +207,7 @@ lstcon_group_alloc(char *name, lstcon_group_t **grpp)
 
 	grp->grp_ref = 1;
 	if (name) {
-		if (strlen(name) > sizeof(grp->grp_name)-1) {
+		if (strlen(name) > sizeof(grp->grp_name) - 1) {
 			LIBCFS_FREE(grp, offsetof(lstcon_group_t,
 				    grp_ndl_hash[LST_NODE_HASHSIZE]));
 			return -E2BIG;
@@ -525,7 +525,7 @@ lstcon_group_add(char *name)
 	lstcon_group_t *grp;
 	int rc;
 
-	rc = lstcon_group_find(name, &grp) ? 0: -EEXIST;
+	rc = lstcon_group_find(name, &grp) ? 0 : -EEXIST;
 	if (rc) {
 		/* find a group with same name */
 		lstcon_group_decref(grp);
@@ -1746,7 +1746,7 @@ lstcon_session_new(char *name, int key, unsigned feats,
 	console_session.ses_timeout = (timeout <= 0) ?
 				      LST_CONSOLE_TIMEOUT : timeout;
 
-	if (strlen(name) > sizeof(console_session.ses_name)-1)
+	if (strlen(name) > sizeof(console_session.ses_name) - 1)
 		return -E2BIG;
 	strncpy(console_session.ses_name, name,
 		sizeof(console_session.ses_name));
diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h
index 9669088..b605f7f 100644
--- a/drivers/staging/lustre/lnet/selftest/selftest.h
+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
@@ -415,7 +415,7 @@ typedef struct sfw_test_case {
 srpc_client_rpc_t *
 sfw_create_rpc(lnet_process_id_t peer, int service,
 	       unsigned features, int nbulkiov, int bulklen,
-	       void (*done) (srpc_client_rpc_t *), void *priv);
+	       void (*done)(srpc_client_rpc_t *), void *priv);
 int sfw_create_test_rpc(sfw_test_unit_t *tsu,
 			lnet_process_id_t peer, unsigned features,
 			int nblk, int blklen, srpc_client_rpc_t **rpc);
diff --git a/drivers/staging/lustre/lnet/selftest/timer.h b/drivers/staging/lustre/lnet/selftest/timer.h
index 2affecf..39327bb 100644
--- a/drivers/staging/lustre/lnet/selftest/timer.h
+++ b/drivers/staging/lustre/lnet/selftest/timer.h
@@ -41,7 +41,7 @@
 struct stt_timer {
 	struct list_head stt_list;
 	time64_t         stt_expires;
-	void             (*stt_func) (void *);
+	void             (*stt_func)(void *);
 	void             *stt_data;
 };
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 04/10] staging: lustre: remove extra spacing of variable declartions for lnet selftest
  2016-03-12  1:29 ` [lustre-devel] " James Simmons
@ 2016-03-12  1:29   ` James Simmons
  -1 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

Remove any extra spacing such as "int   rc" to "int rc" to match
the proper kernel style

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/brw_test.c  |   28 ++++++++--------
 drivers/staging/lustre/lnet/selftest/conctl.c    |   36 ++++++++++----------
 drivers/staging/lustre/lnet/selftest/conrpc.c    |   40 +++++++++++-----------
 drivers/staging/lustre/lnet/selftest/console.c   |   30 ++++++++--------
 drivers/staging/lustre/lnet/selftest/ping_test.c |    2 +-
 drivers/staging/lustre/lnet/selftest/rpc.c       |    8 ++--
 6 files changed, 72 insertions(+), 72 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c
index 18c7422..6b1f983 100644
--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -51,8 +51,8 @@ MODULE_PARM_DESC(brw_inject_errors, "# data errors to inject randomly, zero by d
 static void
 brw_client_fini(sfw_test_instance_t *tsi)
 {
-	srpc_bulk_t     *bulk;
-	sfw_test_unit_t *tsu;
+	srpc_bulk_t *bulk;
+	sfw_test_unit_t	*tsu;
 
 	LASSERT(tsi->tsi_is_client);
 
@@ -69,19 +69,19 @@ brw_client_fini(sfw_test_instance_t *tsi)
 static int
 brw_client_init(sfw_test_instance_t *tsi)
 {
-	sfw_session_t	 *sn = tsi->tsi_batch->bat_session;
-	int		  flags;
-	int		  npg;
-	int		  len;
-	int		  opc;
-	srpc_bulk_t	 *bulk;
-	sfw_test_unit_t	 *tsu;
+	sfw_session_t *sn = tsi->tsi_batch->bat_session;
+	int flags;
+	int npg;
+	int len;
+	int opc;
+	srpc_bulk_t *bulk;
+	sfw_test_unit_t *tsu;
 
 	LASSERT(sn);
 	LASSERT(tsi->tsi_is_client);
 
 	if (!(sn->sn_features & LST_FEAT_BULK_LEN)) {
-		test_bulk_req_t  *breq = &tsi->tsi_u.bulk_v0;
+		test_bulk_req_t *breq = &tsi->tsi_u.bulk_v0;
 
 		opc   = breq->blk_opc;
 		flags = breq->blk_flags;
@@ -155,7 +155,7 @@ static void
 brw_fill_page(struct page *pg, int pattern, __u64 magic)
 {
 	char *addr = page_address(pg);
-	int   i;
+	int i;
 
 	LASSERT(addr);
 
@@ -184,9 +184,9 @@ brw_fill_page(struct page *pg, int pattern, __u64 magic)
 static int
 brw_check_page(struct page *pg, int pattern, __u64 magic)
 {
-	char  *addr = page_address(pg);
-	__u64  data = 0; /* make compiler happy */
-	int    i;
+	char *addr = page_address(pg);
+	__u64 data = 0; /* make compiler happy */
+	int i;
 
 	LASSERT(addr);
 
diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c
index 62cacb6..9793bc6 100644
--- a/drivers/staging/lustre/lnet/selftest/conctl.c
+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
@@ -115,9 +115,9 @@ lst_session_info_ioctl(lstio_session_info_args_t *args)
 static int
 lst_debug_ioctl(lstio_debug_args_t *args)
 {
-	char   *name   = NULL;
-	int     client = 1;
-	int     rc;
+	char *name = NULL;
+	int client = 1;
+	int rc;
 
 	if (args->lstio_dbg_key != console_session.ses_key)
 		return -EACCES;
@@ -229,8 +229,8 @@ lst_group_add_ioctl(lstio_group_add_args_t *args)
 static int
 lst_group_del_ioctl(lstio_group_del_args_t *args)
 {
-	int     rc;
-	char   *name;
+	int rc;
+	char *name;
 
 	if (args->lstio_grp_key != console_session.ses_key)
 		return -EACCES;
@@ -262,8 +262,8 @@ lst_group_del_ioctl(lstio_group_del_args_t *args)
 static int
 lst_group_update_ioctl(lstio_group_update_args_t *args)
 {
-	int     rc;
-	char   *name;
+	int rc;
+	char *name;
 
 	if (args->lstio_grp_key != console_session.ses_key)
 		return -EACCES;
@@ -547,8 +547,8 @@ lst_batch_stop_ioctl(lstio_batch_stop_args_t *args)
 static int
 lst_batch_query_ioctl(lstio_batch_query_args_t *args)
 {
-	char   *name;
-	int     rc;
+	char *name;
+	int rc;
 
 	if (args->lstio_bat_key != console_session.ses_key)
 		return -EACCES;
@@ -714,12 +714,12 @@ lst_stat_query_ioctl(lstio_stat_args_t *args)
 
 static int lst_test_add_ioctl(lstio_test_args_t *args)
 {
-	char		*batch_name;
-	char		*src_name = NULL;
-	char		*dst_name = NULL;
-	void		*param = NULL;
-	int		ret = 0;
-	int		rc = -ENOMEM;
+	char *batch_name;
+	char *src_name = NULL;
+	char *dst_name = NULL;
+	void *param = NULL;
+	int ret = 0;
+	int rc = -ENOMEM;
 
 	if (!args->lstio_tes_resultp ||
 	    !args->lstio_tes_retp ||
@@ -807,10 +807,10 @@ out:
 int
 lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_hdr *hdr)
 {
-	char   *buf;
+	char *buf;
 	struct libcfs_ioctl_data *data;
-	int     opc;
-	int     rc;
+	int opc;
+	int rc;
 
 	if (cmd != IOC_LIBCFS_LNETST)
 		return -EINVAL;
diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index f2afa13..77ea41b 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -288,8 +288,8 @@ void
 lstcon_rpc_trans_abort(lstcon_rpc_trans_t *trans, int error)
 {
 	srpc_client_rpc_t *rpc;
-	lstcon_rpc_t      *crpc;
-	lstcon_node_t     *nd;
+	lstcon_rpc_t *crpc;
+	lstcon_node_t *nd;
 
 	list_for_each_entry(crpc, &trans->tas_rpcs_list, crp_link) {
 		rpc = crpc->crp_rpc;
@@ -388,7 +388,7 @@ lstcon_rpc_trans_postwait(lstcon_rpc_trans_t *trans, int timeout)
 static int
 lstcon_rpc_get_reply(lstcon_rpc_t *crpc, srpc_msg_t **msgpp)
 {
-	lstcon_node_t *nd  = crpc->crp_node;
+	lstcon_node_t *nd = crpc->crp_node;
 	srpc_client_rpc_t *rpc = crpc->crp_rpc;
 	srpc_generic_reply_t *rep;
 
@@ -425,7 +425,7 @@ lstcon_rpc_get_reply(lstcon_rpc_t *crpc, srpc_msg_t **msgpp)
 void
 lstcon_rpc_trans_stat(lstcon_rpc_trans_t *trans, lstcon_trans_stat_t *stat)
 {
-	lstcon_rpc_t  *crpc;
+	lstcon_rpc_t *crpc;
 	srpc_msg_t *rep;
 	int error;
 
@@ -654,9 +654,9 @@ int
 lstcon_batrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 		   lstcon_tsb_hdr_t *tsb, lstcon_rpc_t **crpc)
 {
-	lstcon_batch_t	   *batch;
+	lstcon_batch_t *batch;
 	srpc_batch_reqst_t *brq;
-	int		    rc;
+	int rc;
 
 	rc = lstcon_rpc_prep(nd, SRPC_SERVICE_BATCH, feats, 0, 0, crpc);
 	if (rc)
@@ -687,7 +687,7 @@ int
 lstcon_statrpc_prep(lstcon_node_t *nd, unsigned feats, lstcon_rpc_t **crpc)
 {
 	srpc_stat_reqst_t *srq;
-	int		   rc;
+	int rc;
 
 	rc = lstcon_rpc_prep(nd, SRPC_SERVICE_QUERY_STAT, feats, 0, 0, crpc);
 	if (rc)
@@ -811,14 +811,14 @@ int
 lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 		    lstcon_test_t *test, lstcon_rpc_t **crpc)
 {
-	lstcon_group_t    *sgrp = test->tes_src_grp;
-	lstcon_group_t    *dgrp = test->tes_dst_grp;
+	lstcon_group_t *sgrp = test->tes_src_grp;
+	lstcon_group_t *dgrp = test->tes_dst_grp;
 	srpc_test_reqst_t *trq;
-	srpc_bulk_t       *bulk;
-	int                i;
-	int		   npg = 0;
-	int		   nob = 0;
-	int		   rc  = 0;
+	srpc_bulk_t *bulk;
+	int i;
+	int npg = 0;
+	int nob = 0;
+	int rc  = 0;
 
 	if (transop == LST_TRANS_TSBCLIADD) {
 		npg = sfw_id_pages(test->tes_span);
@@ -847,7 +847,7 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 		bulk = &(*crpc)->crp_rpc->crpc_bulk;
 
 		for (i = 0; i < npg; i++) {
-			int	len;
+			int len;
 
 			LASSERT(nob > 0);
 
@@ -922,7 +922,7 @@ lstcon_sesnew_stat_reply(lstcon_rpc_trans_t *trans,
 			 lstcon_node_t *nd, srpc_msg_t *reply)
 {
 	srpc_mksn_reply_t *mksn_rep = &reply->msg_body.mksn_reply;
-	int		   status   = mksn_rep->mksn_status;
+	int status = mksn_rep->mksn_status;
 
 	if (!status &&
 	    (reply->msg_ses_feats & ~LST_FEATS_MASK)) {
@@ -968,12 +968,12 @@ void
 lstcon_rpc_stat_reply(lstcon_rpc_trans_t *trans, srpc_msg_t *msg,
 		      lstcon_node_t *nd, lstcon_trans_stat_t *stat)
 {
-	srpc_rmsn_reply_t  *rmsn_rep;
+	srpc_rmsn_reply_t *rmsn_rep;
 	srpc_debug_reply_t *dbg_rep;
 	srpc_batch_reply_t *bat_rep;
-	srpc_test_reply_t  *test_rep;
-	srpc_stat_reply_t  *stat_rep;
-	int                rc = 0;
+	srpc_test_reply_t *test_rep;
+	srpc_stat_reply_t *stat_rep;
+	int rc = 0;
 
 	switch (trans->tas_opc) {
 	case LST_TRANS_SESNEW:
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index b0c9acd..aac159b 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -71,7 +71,7 @@ lstcon_node_get(lstcon_node_t *nd)
 static int
 lstcon_node_find(lnet_process_id_t id, lstcon_node_t **ndpp, int create)
 {
-	lstcon_ndlink_t *ndl;
+	lstcon_ndlink_t	*ndl;
 	unsigned int idx = LNET_NIDADDR(id.nid) % LST_GLOBAL_HASHSIZE;
 
 	LASSERT(id.nid != LNET_NID_ANY);
@@ -403,7 +403,7 @@ lstcon_group_nodes_add(lstcon_group_t *grp,
 		       unsigned *featp, struct list_head __user *result_up)
 {
 	lstcon_rpc_trans_t *trans;
-	lstcon_ndlink_t *ndl;
+	lstcon_ndlink_t	*ndl;
 	lstcon_group_t *tmp;
 	lnet_process_id_t id;
 	int i;
@@ -935,7 +935,7 @@ lstcon_batch_info(char *name, lstcon_test_batch_ent_t __user *ent_up,
 	struct list_head *srvlst;
 	lstcon_test_t *test = NULL;
 	lstcon_batch_t *bat;
-	lstcon_ndlink_t *ndl;
+	lstcon_ndlink_t	*ndl;
 	int rc;
 
 	rc = lstcon_batch_find(name, &bat);
@@ -1258,7 +1258,7 @@ static int
 lstcon_verify_group(const char *name, lstcon_group_t **grp)
 {
 	int rc;
-	lstcon_ndlink_t *ndl;
+	lstcon_ndlink_t	*ndl;
 
 	rc = lstcon_group_find(name, grp);
 	if (rc) {
@@ -1283,11 +1283,11 @@ lstcon_test_add(char *batch_name, int type, int loop,
 		void *param, int paramlen, int *retp,
 		struct list_head __user *result_up)
 {
-	lstcon_test_t	 *test	 = NULL;
-	int		 rc;
-	lstcon_group_t	 *src_grp = NULL;
-	lstcon_group_t	 *dst_grp = NULL;
-	lstcon_batch_t	 *batch = NULL;
+	lstcon_test_t *test = NULL;
+	int rc;
+	lstcon_group_t *src_grp = NULL;
+	lstcon_group_t *dst_grp = NULL;
+	lstcon_batch_t *batch = NULL;
 
 	/*
 	 * verify that a batch of the given name exists, and the groups
@@ -1535,7 +1535,7 @@ int
 lstcon_nodes_stat(int count, lnet_process_id_t __user *ids_up,
 		  int timeout, struct list_head __user *result_up)
 {
-	lstcon_ndlink_t *ndl;
+	lstcon_ndlink_t	*ndl;
 	lstcon_group_t *tmp;
 	lnet_process_id_t id;
 	int i;
@@ -1581,7 +1581,7 @@ lstcon_debug_ndlist(struct list_head *ndlist,
 		    int timeout, struct list_head __user *result_up)
 {
 	lstcon_rpc_trans_t *trans;
-	int		 rc;
+	int rc;
 
 	rc = lstcon_rpc_trans_ndlist(ndlist, translist, LST_TRANS_SESQRY,
 				     NULL, lstcon_sesrpc_condition, &trans);
@@ -1905,13 +1905,13 @@ lstcon_session_feats_check(unsigned feats)
 static int
 lstcon_acceptor_handle(struct srpc_server_rpc *rpc)
 {
-	srpc_msg_t *rep  = &rpc->srpc_replymsg;
-	srpc_msg_t *req  = &rpc->srpc_reqstbuf->buf_msg;
+	srpc_msg_t *rep	= &rpc->srpc_replymsg;
+	srpc_msg_t *req	= &rpc->srpc_reqstbuf->buf_msg;
 	srpc_join_reqst_t *jreq = &req->msg_body.join_reqst;
 	srpc_join_reply_t *jrep = &rep->msg_body.join_reply;
-	lstcon_group_t *grp  = NULL;
+	lstcon_group_t *grp = NULL;
 	lstcon_ndlink_t *ndl;
-	int rc   = 0;
+	int rc = 0;
 
 	sfw_unpack_message(req);
 
diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c b/drivers/staging/lustre/lnet/selftest/ping_test.c
index 33c758a..b5e69a7 100644
--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
@@ -170,7 +170,7 @@ ping_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
 static int
 ping_server_handle(struct srpc_server_rpc *rpc)
 {
-	struct srpc_service *sv  = rpc->srpc_scd->scd_svc;
+	struct srpc_service *sv = rpc->srpc_scd->scd_svc;
 	srpc_msg_t *reqstmsg = &rpc->srpc_reqstbuf->buf_msg;
 	srpc_msg_t *replymsg = &rpc->srpc_replymsg;
 	srpc_ping_reqst_t *req = &reqstmsg->msg_body.ping_reqst;
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index 08a0ad5..1af978f 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -451,7 +451,7 @@ static int
 srpc_post_passive_rqtbuf(int service, int local, void *buf, int len,
 			 lnet_handle_md_t *mdh, srpc_event_t *ev)
 {
-	lnet_process_id_t any = {0};
+	lnet_process_id_t any = { 0 };
 
 	any.nid = LNET_NID_ANY;
 	any.pid = LNET_PID_ANY;
@@ -466,7 +466,7 @@ srpc_service_post_buffer(struct srpc_service_cd *scd, struct srpc_buffer *buf)
 	__must_hold(&scd->scd_lock)
 {
 	struct srpc_service *sv = scd->scd_svc;
-	struct srpc_msg *msg = &buf->buf_msg;
+	struct srpc_msg	*msg = &buf->buf_msg;
 	int rc;
 
 	LNetInvalidateHandle(&buf->buf_mdh);
@@ -842,7 +842,7 @@ srpc_prepare_bulk(srpc_client_rpc_t *rpc)
 {
 	srpc_bulk_t *bk = &rpc->crpc_bulk;
 	srpc_event_t *ev = &rpc->crpc_bulkev;
-	__u64	*id = &rpc->crpc_reqstmsg.msg_body.reqst.bulkid;
+	__u64 *id = &rpc->crpc_reqstmsg.msg_body.reqst.bulkid;
 	int rc;
 	int opt;
 
@@ -902,7 +902,7 @@ static void
 srpc_server_rpc_done(struct srpc_server_rpc *rpc, int status)
 {
 	struct srpc_service_cd *scd = rpc->srpc_scd;
-	struct srpc_service *sv  = scd->scd_svc;
+	struct srpc_service *sv = scd->scd_svc;
 	srpc_buffer_t *buffer;
 
 	LASSERT(status || rpc->srpc_wi.swi_state == SWI_STATE_DONE);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 04/10] staging: lustre: remove extra spacing of variable declartions for lnet selftest
@ 2016-03-12  1:29   ` James Simmons
  0 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

Remove any extra spacing such as "int   rc" to "int rc" to match
the proper kernel style

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/brw_test.c  |   28 ++++++++--------
 drivers/staging/lustre/lnet/selftest/conctl.c    |   36 ++++++++++----------
 drivers/staging/lustre/lnet/selftest/conrpc.c    |   40 +++++++++++-----------
 drivers/staging/lustre/lnet/selftest/console.c   |   30 ++++++++--------
 drivers/staging/lustre/lnet/selftest/ping_test.c |    2 +-
 drivers/staging/lustre/lnet/selftest/rpc.c       |    8 ++--
 6 files changed, 72 insertions(+), 72 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c
index 18c7422..6b1f983 100644
--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -51,8 +51,8 @@ MODULE_PARM_DESC(brw_inject_errors, "# data errors to inject randomly, zero by d
 static void
 brw_client_fini(sfw_test_instance_t *tsi)
 {
-	srpc_bulk_t     *bulk;
-	sfw_test_unit_t *tsu;
+	srpc_bulk_t *bulk;
+	sfw_test_unit_t	*tsu;
 
 	LASSERT(tsi->tsi_is_client);
 
@@ -69,19 +69,19 @@ brw_client_fini(sfw_test_instance_t *tsi)
 static int
 brw_client_init(sfw_test_instance_t *tsi)
 {
-	sfw_session_t	 *sn = tsi->tsi_batch->bat_session;
-	int		  flags;
-	int		  npg;
-	int		  len;
-	int		  opc;
-	srpc_bulk_t	 *bulk;
-	sfw_test_unit_t	 *tsu;
+	sfw_session_t *sn = tsi->tsi_batch->bat_session;
+	int flags;
+	int npg;
+	int len;
+	int opc;
+	srpc_bulk_t *bulk;
+	sfw_test_unit_t *tsu;
 
 	LASSERT(sn);
 	LASSERT(tsi->tsi_is_client);
 
 	if (!(sn->sn_features & LST_FEAT_BULK_LEN)) {
-		test_bulk_req_t  *breq = &tsi->tsi_u.bulk_v0;
+		test_bulk_req_t *breq = &tsi->tsi_u.bulk_v0;
 
 		opc   = breq->blk_opc;
 		flags = breq->blk_flags;
@@ -155,7 +155,7 @@ static void
 brw_fill_page(struct page *pg, int pattern, __u64 magic)
 {
 	char *addr = page_address(pg);
-	int   i;
+	int i;
 
 	LASSERT(addr);
 
@@ -184,9 +184,9 @@ brw_fill_page(struct page *pg, int pattern, __u64 magic)
 static int
 brw_check_page(struct page *pg, int pattern, __u64 magic)
 {
-	char  *addr = page_address(pg);
-	__u64  data = 0; /* make compiler happy */
-	int    i;
+	char *addr = page_address(pg);
+	__u64 data = 0; /* make compiler happy */
+	int i;
 
 	LASSERT(addr);
 
diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c
index 62cacb6..9793bc6 100644
--- a/drivers/staging/lustre/lnet/selftest/conctl.c
+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
@@ -115,9 +115,9 @@ lst_session_info_ioctl(lstio_session_info_args_t *args)
 static int
 lst_debug_ioctl(lstio_debug_args_t *args)
 {
-	char   *name   = NULL;
-	int     client = 1;
-	int     rc;
+	char *name = NULL;
+	int client = 1;
+	int rc;
 
 	if (args->lstio_dbg_key != console_session.ses_key)
 		return -EACCES;
@@ -229,8 +229,8 @@ lst_group_add_ioctl(lstio_group_add_args_t *args)
 static int
 lst_group_del_ioctl(lstio_group_del_args_t *args)
 {
-	int     rc;
-	char   *name;
+	int rc;
+	char *name;
 
 	if (args->lstio_grp_key != console_session.ses_key)
 		return -EACCES;
@@ -262,8 +262,8 @@ lst_group_del_ioctl(lstio_group_del_args_t *args)
 static int
 lst_group_update_ioctl(lstio_group_update_args_t *args)
 {
-	int     rc;
-	char   *name;
+	int rc;
+	char *name;
 
 	if (args->lstio_grp_key != console_session.ses_key)
 		return -EACCES;
@@ -547,8 +547,8 @@ lst_batch_stop_ioctl(lstio_batch_stop_args_t *args)
 static int
 lst_batch_query_ioctl(lstio_batch_query_args_t *args)
 {
-	char   *name;
-	int     rc;
+	char *name;
+	int rc;
 
 	if (args->lstio_bat_key != console_session.ses_key)
 		return -EACCES;
@@ -714,12 +714,12 @@ lst_stat_query_ioctl(lstio_stat_args_t *args)
 
 static int lst_test_add_ioctl(lstio_test_args_t *args)
 {
-	char		*batch_name;
-	char		*src_name = NULL;
-	char		*dst_name = NULL;
-	void		*param = NULL;
-	int		ret = 0;
-	int		rc = -ENOMEM;
+	char *batch_name;
+	char *src_name = NULL;
+	char *dst_name = NULL;
+	void *param = NULL;
+	int ret = 0;
+	int rc = -ENOMEM;
 
 	if (!args->lstio_tes_resultp ||
 	    !args->lstio_tes_retp ||
@@ -807,10 +807,10 @@ out:
 int
 lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_hdr *hdr)
 {
-	char   *buf;
+	char *buf;
 	struct libcfs_ioctl_data *data;
-	int     opc;
-	int     rc;
+	int opc;
+	int rc;
 
 	if (cmd != IOC_LIBCFS_LNETST)
 		return -EINVAL;
diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index f2afa13..77ea41b 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -288,8 +288,8 @@ void
 lstcon_rpc_trans_abort(lstcon_rpc_trans_t *trans, int error)
 {
 	srpc_client_rpc_t *rpc;
-	lstcon_rpc_t      *crpc;
-	lstcon_node_t     *nd;
+	lstcon_rpc_t *crpc;
+	lstcon_node_t *nd;
 
 	list_for_each_entry(crpc, &trans->tas_rpcs_list, crp_link) {
 		rpc = crpc->crp_rpc;
@@ -388,7 +388,7 @@ lstcon_rpc_trans_postwait(lstcon_rpc_trans_t *trans, int timeout)
 static int
 lstcon_rpc_get_reply(lstcon_rpc_t *crpc, srpc_msg_t **msgpp)
 {
-	lstcon_node_t *nd  = crpc->crp_node;
+	lstcon_node_t *nd = crpc->crp_node;
 	srpc_client_rpc_t *rpc = crpc->crp_rpc;
 	srpc_generic_reply_t *rep;
 
@@ -425,7 +425,7 @@ lstcon_rpc_get_reply(lstcon_rpc_t *crpc, srpc_msg_t **msgpp)
 void
 lstcon_rpc_trans_stat(lstcon_rpc_trans_t *trans, lstcon_trans_stat_t *stat)
 {
-	lstcon_rpc_t  *crpc;
+	lstcon_rpc_t *crpc;
 	srpc_msg_t *rep;
 	int error;
 
@@ -654,9 +654,9 @@ int
 lstcon_batrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 		   lstcon_tsb_hdr_t *tsb, lstcon_rpc_t **crpc)
 {
-	lstcon_batch_t	   *batch;
+	lstcon_batch_t *batch;
 	srpc_batch_reqst_t *brq;
-	int		    rc;
+	int rc;
 
 	rc = lstcon_rpc_prep(nd, SRPC_SERVICE_BATCH, feats, 0, 0, crpc);
 	if (rc)
@@ -687,7 +687,7 @@ int
 lstcon_statrpc_prep(lstcon_node_t *nd, unsigned feats, lstcon_rpc_t **crpc)
 {
 	srpc_stat_reqst_t *srq;
-	int		   rc;
+	int rc;
 
 	rc = lstcon_rpc_prep(nd, SRPC_SERVICE_QUERY_STAT, feats, 0, 0, crpc);
 	if (rc)
@@ -811,14 +811,14 @@ int
 lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 		    lstcon_test_t *test, lstcon_rpc_t **crpc)
 {
-	lstcon_group_t    *sgrp = test->tes_src_grp;
-	lstcon_group_t    *dgrp = test->tes_dst_grp;
+	lstcon_group_t *sgrp = test->tes_src_grp;
+	lstcon_group_t *dgrp = test->tes_dst_grp;
 	srpc_test_reqst_t *trq;
-	srpc_bulk_t       *bulk;
-	int                i;
-	int		   npg = 0;
-	int		   nob = 0;
-	int		   rc  = 0;
+	srpc_bulk_t *bulk;
+	int i;
+	int npg = 0;
+	int nob = 0;
+	int rc  = 0;
 
 	if (transop == LST_TRANS_TSBCLIADD) {
 		npg = sfw_id_pages(test->tes_span);
@@ -847,7 +847,7 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 		bulk = &(*crpc)->crp_rpc->crpc_bulk;
 
 		for (i = 0; i < npg; i++) {
-			int	len;
+			int len;
 
 			LASSERT(nob > 0);
 
@@ -922,7 +922,7 @@ lstcon_sesnew_stat_reply(lstcon_rpc_trans_t *trans,
 			 lstcon_node_t *nd, srpc_msg_t *reply)
 {
 	srpc_mksn_reply_t *mksn_rep = &reply->msg_body.mksn_reply;
-	int		   status   = mksn_rep->mksn_status;
+	int status = mksn_rep->mksn_status;
 
 	if (!status &&
 	    (reply->msg_ses_feats & ~LST_FEATS_MASK)) {
@@ -968,12 +968,12 @@ void
 lstcon_rpc_stat_reply(lstcon_rpc_trans_t *trans, srpc_msg_t *msg,
 		      lstcon_node_t *nd, lstcon_trans_stat_t *stat)
 {
-	srpc_rmsn_reply_t  *rmsn_rep;
+	srpc_rmsn_reply_t *rmsn_rep;
 	srpc_debug_reply_t *dbg_rep;
 	srpc_batch_reply_t *bat_rep;
-	srpc_test_reply_t  *test_rep;
-	srpc_stat_reply_t  *stat_rep;
-	int                rc = 0;
+	srpc_test_reply_t *test_rep;
+	srpc_stat_reply_t *stat_rep;
+	int rc = 0;
 
 	switch (trans->tas_opc) {
 	case LST_TRANS_SESNEW:
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index b0c9acd..aac159b 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -71,7 +71,7 @@ lstcon_node_get(lstcon_node_t *nd)
 static int
 lstcon_node_find(lnet_process_id_t id, lstcon_node_t **ndpp, int create)
 {
-	lstcon_ndlink_t *ndl;
+	lstcon_ndlink_t	*ndl;
 	unsigned int idx = LNET_NIDADDR(id.nid) % LST_GLOBAL_HASHSIZE;
 
 	LASSERT(id.nid != LNET_NID_ANY);
@@ -403,7 +403,7 @@ lstcon_group_nodes_add(lstcon_group_t *grp,
 		       unsigned *featp, struct list_head __user *result_up)
 {
 	lstcon_rpc_trans_t *trans;
-	lstcon_ndlink_t *ndl;
+	lstcon_ndlink_t	*ndl;
 	lstcon_group_t *tmp;
 	lnet_process_id_t id;
 	int i;
@@ -935,7 +935,7 @@ lstcon_batch_info(char *name, lstcon_test_batch_ent_t __user *ent_up,
 	struct list_head *srvlst;
 	lstcon_test_t *test = NULL;
 	lstcon_batch_t *bat;
-	lstcon_ndlink_t *ndl;
+	lstcon_ndlink_t	*ndl;
 	int rc;
 
 	rc = lstcon_batch_find(name, &bat);
@@ -1258,7 +1258,7 @@ static int
 lstcon_verify_group(const char *name, lstcon_group_t **grp)
 {
 	int rc;
-	lstcon_ndlink_t *ndl;
+	lstcon_ndlink_t	*ndl;
 
 	rc = lstcon_group_find(name, grp);
 	if (rc) {
@@ -1283,11 +1283,11 @@ lstcon_test_add(char *batch_name, int type, int loop,
 		void *param, int paramlen, int *retp,
 		struct list_head __user *result_up)
 {
-	lstcon_test_t	 *test	 = NULL;
-	int		 rc;
-	lstcon_group_t	 *src_grp = NULL;
-	lstcon_group_t	 *dst_grp = NULL;
-	lstcon_batch_t	 *batch = NULL;
+	lstcon_test_t *test = NULL;
+	int rc;
+	lstcon_group_t *src_grp = NULL;
+	lstcon_group_t *dst_grp = NULL;
+	lstcon_batch_t *batch = NULL;
 
 	/*
 	 * verify that a batch of the given name exists, and the groups
@@ -1535,7 +1535,7 @@ int
 lstcon_nodes_stat(int count, lnet_process_id_t __user *ids_up,
 		  int timeout, struct list_head __user *result_up)
 {
-	lstcon_ndlink_t *ndl;
+	lstcon_ndlink_t	*ndl;
 	lstcon_group_t *tmp;
 	lnet_process_id_t id;
 	int i;
@@ -1581,7 +1581,7 @@ lstcon_debug_ndlist(struct list_head *ndlist,
 		    int timeout, struct list_head __user *result_up)
 {
 	lstcon_rpc_trans_t *trans;
-	int		 rc;
+	int rc;
 
 	rc = lstcon_rpc_trans_ndlist(ndlist, translist, LST_TRANS_SESQRY,
 				     NULL, lstcon_sesrpc_condition, &trans);
@@ -1905,13 +1905,13 @@ lstcon_session_feats_check(unsigned feats)
 static int
 lstcon_acceptor_handle(struct srpc_server_rpc *rpc)
 {
-	srpc_msg_t *rep  = &rpc->srpc_replymsg;
-	srpc_msg_t *req  = &rpc->srpc_reqstbuf->buf_msg;
+	srpc_msg_t *rep	= &rpc->srpc_replymsg;
+	srpc_msg_t *req	= &rpc->srpc_reqstbuf->buf_msg;
 	srpc_join_reqst_t *jreq = &req->msg_body.join_reqst;
 	srpc_join_reply_t *jrep = &rep->msg_body.join_reply;
-	lstcon_group_t *grp  = NULL;
+	lstcon_group_t *grp = NULL;
 	lstcon_ndlink_t *ndl;
-	int rc   = 0;
+	int rc = 0;
 
 	sfw_unpack_message(req);
 
diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c b/drivers/staging/lustre/lnet/selftest/ping_test.c
index 33c758a..b5e69a7 100644
--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
@@ -170,7 +170,7 @@ ping_client_done_rpc(sfw_test_unit_t *tsu, srpc_client_rpc_t *rpc)
 static int
 ping_server_handle(struct srpc_server_rpc *rpc)
 {
-	struct srpc_service *sv  = rpc->srpc_scd->scd_svc;
+	struct srpc_service *sv = rpc->srpc_scd->scd_svc;
 	srpc_msg_t *reqstmsg = &rpc->srpc_reqstbuf->buf_msg;
 	srpc_msg_t *replymsg = &rpc->srpc_replymsg;
 	srpc_ping_reqst_t *req = &reqstmsg->msg_body.ping_reqst;
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index 08a0ad5..1af978f 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -451,7 +451,7 @@ static int
 srpc_post_passive_rqtbuf(int service, int local, void *buf, int len,
 			 lnet_handle_md_t *mdh, srpc_event_t *ev)
 {
-	lnet_process_id_t any = {0};
+	lnet_process_id_t any = { 0 };
 
 	any.nid = LNET_NID_ANY;
 	any.pid = LNET_PID_ANY;
@@ -466,7 +466,7 @@ srpc_service_post_buffer(struct srpc_service_cd *scd, struct srpc_buffer *buf)
 	__must_hold(&scd->scd_lock)
 {
 	struct srpc_service *sv = scd->scd_svc;
-	struct srpc_msg *msg = &buf->buf_msg;
+	struct srpc_msg	*msg = &buf->buf_msg;
 	int rc;
 
 	LNetInvalidateHandle(&buf->buf_mdh);
@@ -842,7 +842,7 @@ srpc_prepare_bulk(srpc_client_rpc_t *rpc)
 {
 	srpc_bulk_t *bk = &rpc->crpc_bulk;
 	srpc_event_t *ev = &rpc->crpc_bulkev;
-	__u64	*id = &rpc->crpc_reqstmsg.msg_body.reqst.bulkid;
+	__u64 *id = &rpc->crpc_reqstmsg.msg_body.reqst.bulkid;
 	int rc;
 	int opt;
 
@@ -902,7 +902,7 @@ static void
 srpc_server_rpc_done(struct srpc_server_rpc *rpc, int status)
 {
 	struct srpc_service_cd *scd = rpc->srpc_scd;
-	struct srpc_service *sv  = scd->scd_svc;
+	struct srpc_service *sv = scd->scd_svc;
 	srpc_buffer_t *buffer;
 
 	LASSERT(status || rpc->srpc_wi.swi_state == SWI_STATE_DONE);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 05/10] staging: lustre: remove extra spacing when setting variable for lnet selftest
  2016-03-12  1:29 ` [lustre-devel] " James Simmons
@ 2016-03-12  1:29   ` James Simmons
  -1 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

Remove any extra spacing for the lines of code setting variables to
some value.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/brw_test.c  |   40 ++++++------
 drivers/staging/lustre/lnet/selftest/conrpc.c    |   68 ++++++++++----------
 drivers/staging/lustre/lnet/selftest/console.c   |   78 +++++++++++-----------
 drivers/staging/lustre/lnet/selftest/framework.c |   60 ++++++++--------
 drivers/staging/lustre/lnet/selftest/ping_test.c |   14 ++--
 drivers/staging/lustre/lnet/selftest/rpc.c       |   68 ++++++++++----------
 drivers/staging/lustre/lnet/selftest/selftest.h  |   20 +++---
 7 files changed, 174 insertions(+), 174 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c
index 6b1f983..0d0c22c 100644
--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -83,14 +83,14 @@ brw_client_init(sfw_test_instance_t *tsi)
 	if (!(sn->sn_features & LST_FEAT_BULK_LEN)) {
 		test_bulk_req_t *breq = &tsi->tsi_u.bulk_v0;
 
-		opc   = breq->blk_opc;
+		opc = breq->blk_opc;
 		flags = breq->blk_flags;
-		npg   = breq->blk_npg;
+		npg = breq->blk_npg;
 		/*
 		 * NB: this is not going to work for variable page size,
 		 * but we have to keep it for compatibility
 		 */
-		len   = npg * PAGE_CACHE_SIZE;
+		len = npg * PAGE_CACHE_SIZE;
 
 	} else {
 		test_bulk_req_v1_t *breq = &tsi->tsi_u.bulk_v1;
@@ -101,10 +101,10 @@ brw_client_init(sfw_test_instance_t *tsi)
 		 */
 		LASSERT(!(sn->sn_features & ~LST_FEATS_MASK));
 
-		opc   = breq->blk_opc;
+		opc = breq->blk_opc;
 		flags = breq->blk_flags;
-		len   = breq->blk_len;
-		npg   = (len + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+		len = breq->blk_len;
+		npg = (len + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
 	}
 
 	if (npg > LNET_MAX_IOV || npg <= 0)
@@ -275,10 +275,10 @@ brw_client_prep_rpc(sfw_test_unit_t *tsu,
 	if (!(sn->sn_features & LST_FEAT_BULK_LEN)) {
 		test_bulk_req_t *breq = &tsi->tsi_u.bulk_v0;
 
-		opc   = breq->blk_opc;
+		opc = breq->blk_opc;
 		flags = breq->blk_flags;
-		npg   = breq->blk_npg;
-		len   = npg * PAGE_CACHE_SIZE;
+		npg = breq->blk_npg;
+		len = npg * PAGE_CACHE_SIZE;
 
 	} else {
 		test_bulk_req_v1_t *breq = &tsi->tsi_u.bulk_v1;
@@ -289,10 +289,10 @@ brw_client_prep_rpc(sfw_test_unit_t *tsu,
 		 */
 		LASSERT(!(sn->sn_features & ~LST_FEATS_MASK));
 
-		opc   = breq->blk_opc;
+		opc = breq->blk_opc;
 		flags = breq->blk_flags;
-		len   = breq->blk_len;
-		npg   = (len + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+		len = breq->blk_len;
+		npg = (len + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
 	}
 
 	rc = sfw_create_test_rpc(tsu, dest, sn->sn_features, npg, len, &rpc);
@@ -307,8 +307,8 @@ brw_client_prep_rpc(sfw_test_unit_t *tsu,
 
 	req = &rpc->crpc_reqstmsg.msg_body.brw_reqst;
 	req->brw_flags = flags;
-	req->brw_rw    = opc;
-	req->brw_len   = len;
+	req->brw_rw = opc;
+	req->brw_len = len;
 
 	*rpcpp = rpc;
 	return 0;
@@ -493,8 +493,8 @@ brw_server_handle(struct srpc_server_rpc *rpc)
 sfw_test_client_ops_t brw_test_client;
 void brw_init_test_client(void)
 {
-	brw_test_client.tso_init     = brw_client_init;
-	brw_test_client.tso_fini     = brw_client_fini;
+	brw_test_client.tso_init = brw_client_init;
+	brw_test_client.tso_fini = brw_client_fini;
 	brw_test_client.tso_prep_rpc = brw_client_prep_rpc;
 	brw_test_client.tso_done_rpc = brw_client_done_rpc;
 };
@@ -502,9 +502,9 @@ void brw_init_test_client(void)
 srpc_service_t brw_test_service;
 void brw_init_test_service(void)
 {
-	brw_test_service.sv_id         = SRPC_SERVICE_BRW;
-	brw_test_service.sv_name       = "brw_test";
-	brw_test_service.sv_handler    = brw_server_handle;
+	brw_test_service.sv_id = SRPC_SERVICE_BRW;
+	brw_test_service.sv_name = "brw_test";
+	brw_test_service.sv_handler = brw_server_handle;
 	brw_test_service.sv_bulk_ready = brw_bulk_ready;
-	brw_test_service.sv_wi_total   = brw_srv_workitems;
+	brw_test_service.sv_wi_total = brw_srv_workitems;
 }
diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index 77ea41b..cdb660e 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -78,7 +78,7 @@ lstcon_rpc_done(srpc_client_rpc_t *rpc)
 		/* not aborted */
 		LASSERT(!crpc->crp_status);
 
-		crpc->crp_stamp  = cfs_time_current();
+		crpc->crp_stamp = cfs_time_current();
 		crpc->crp_status = rpc->crpc_status;
 	}
 
@@ -99,13 +99,13 @@ lstcon_rpc_init(lstcon_node_t *nd, int service, unsigned feats,
 	if (!crpc->crp_rpc)
 		return -ENOMEM;
 
-	crpc->crp_trans    = NULL;
-	crpc->crp_node     = nd;
-	crpc->crp_posted   = 0;
+	crpc->crp_trans = NULL;
+	crpc->crp_node = nd;
+	crpc->crp_posted = 0;
 	crpc->crp_finished = 0;
 	crpc->crp_unpacked = 0;
-	crpc->crp_status   = 0;
-	crpc->crp_stamp    = 0;
+	crpc->crp_status = 0;
+	crpc->crp_stamp = 0;
 	crpc->crp_embedded = embedded;
 	INIT_LIST_HEAD(&crpc->crp_link);
 
@@ -306,7 +306,7 @@ lstcon_rpc_trans_abort(lstcon_rpc_trans_t *trans, int error)
 			continue;
 		}
 
-		crpc->crp_stamp  = cfs_time_current();
+		crpc->crp_stamp = cfs_time_current();
 		crpc->crp_status = error;
 
 		spin_unlock(&rpc->crpc_lock);
@@ -571,7 +571,7 @@ lstcon_rpc_trans_destroy(lstcon_rpc_trans_t *trans)
 		 */
 		LASSERT(crpc->crp_status);
 
-		crpc->crp_node  = NULL;
+		crpc->crp_node = NULL;
 		crpc->crp_trans = NULL;
 		list_del_init(&crpc->crp_link);
 		count++;
@@ -609,8 +609,8 @@ lstcon_sesrpc_prep(lstcon_node_t *nd, int transop,
 			return rc;
 
 		msrq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.mksn_reqst;
-		msrq->mksn_sid     = console_session.ses_id;
-		msrq->mksn_force   = console_session.ses_force;
+		msrq->mksn_sid = console_session.ses_id;
+		msrq->mksn_force = console_session.ses_force;
 		strlcpy(msrq->mksn_name, console_session.ses_name,
 			sizeof(msrq->mksn_name));
 		break;
@@ -644,7 +644,7 @@ lstcon_dbgrpc_prep(lstcon_node_t *nd, unsigned feats, lstcon_rpc_t **crpc)
 
 	drq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.dbg_reqst;
 
-	drq->dbg_sid   = console_session.ses_id;
+	drq->dbg_sid = console_session.ses_id;
 	drq->dbg_flags = 0;
 
 	return rc;
@@ -664,10 +664,10 @@ lstcon_batrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 
 	brq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.bat_reqst;
 
-	brq->bar_sid     = console_session.ses_id;
-	brq->bar_bid     = tsb->tsb_id;
+	brq->bar_sid = console_session.ses_id;
+	brq->bar_bid = tsb->tsb_id;
 	brq->bar_testidx = tsb->tsb_index;
-	brq->bar_opc     = transop == LST_TRANS_TSBRUN ? SRPC_BATCH_OPC_RUN :
+	brq->bar_opc = transop == LST_TRANS_TSBRUN ? SRPC_BATCH_OPC_RUN :
 			   (transop == LST_TRANS_TSBSTOP ? SRPC_BATCH_OPC_STOP :
 			    SRPC_BATCH_OPC_QUERY);
 
@@ -695,7 +695,7 @@ lstcon_statrpc_prep(lstcon_node_t *nd, unsigned feats, lstcon_rpc_t **crpc)
 
 	srq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.stat_reqst;
 
-	srq->str_sid  = console_session.ses_id;
+	srq->str_sid = console_session.ses_id;
 	srq->str_type = 0; /* XXX remove it */
 
 	return 0;
@@ -735,7 +735,7 @@ lstcon_dstnodes_prep(lstcon_group_t *grp, int idx,
 		return -EINVAL;
 
 	start = ((idx / dist) * span) % grp->grp_nnode;
-	end   = ((idx / dist) * span + span - 1) % grp->grp_nnode;
+	end = ((idx / dist) * span + span - 1) % grp->grp_nnode;
 
 	list_for_each_entry(ndl, &grp->grp_ndl_list, ndl_link) {
 		nd = ndl->ndl_node;
@@ -775,7 +775,7 @@ lstcon_pingrpc_prep(lst_test_ping_param_t *param, srpc_test_reqst_t *req)
 {
 	test_ping_req_t *prq = &req->tsr_u.ping;
 
-	prq->png_size  = param->png_size;
+	prq->png_size = param->png_size;
 	prq->png_flags = param->png_flags;
 	/* TODO dest */
 	return 0;
@@ -786,9 +786,9 @@ lstcon_bulkrpc_v0_prep(lst_test_bulk_param_t *param, srpc_test_reqst_t *req)
 {
 	test_bulk_req_t *brq = &req->tsr_u.bulk_v0;
 
-	brq->blk_opc   = param->blk_opc;
-	brq->blk_npg   = (param->blk_size + PAGE_CACHE_SIZE - 1) /
-			  PAGE_CACHE_SIZE;
+	brq->blk_opc = param->blk_opc;
+	brq->blk_npg = (param->blk_size + PAGE_CACHE_SIZE - 1) /
+			PAGE_CACHE_SIZE;
 	brq->blk_flags = param->blk_flags;
 
 	return 0;
@@ -799,9 +799,9 @@ lstcon_bulkrpc_v1_prep(lst_test_bulk_param_t *param, srpc_test_reqst_t *req)
 {
 	test_bulk_req_v1_t *brq = &req->tsr_u.bulk_v1;
 
-	brq->blk_opc	= param->blk_opc;
-	brq->blk_flags	= param->blk_flags;
-	brq->blk_len	= param->blk_size;
+	brq->blk_opc = param->blk_opc;
+	brq->blk_flags = param->blk_flags;
+	brq->blk_len = param->blk_size;
 	brq->blk_offset	= 0; /* reserved */
 
 	return 0;
@@ -818,7 +818,7 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 	int i;
 	int npg = 0;
 	int nob = 0;
-	int rc  = 0;
+	int rc = 0;
 
 	if (transop == LST_TRANS_TSBCLIADD) {
 		npg = sfw_id_pages(test->tes_span);
@@ -831,7 +831,7 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 	if (rc)
 		return rc;
 
-	trq  = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.tes_reqst;
+	trq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.tes_reqst;
 
 	if (transop == LST_TRANS_TSBSRVADD) {
 		int ndist = (sgrp->grp_nnode + test->tes_dist - 1) /
@@ -841,7 +841,7 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 		int nmax = (ndist + nspan - 1) / nspan;
 
 		trq->tsr_ndest = 0;
-		trq->tsr_loop  = nmax * test->tes_dist * test->tes_concur;
+		trq->tsr_loop = nmax * test->tes_dist * test->tes_concur;
 
 	} else {
 		bulk = &(*crpc)->crp_rpc->crpc_bulk;
@@ -857,8 +857,8 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 			nob -= len;
 
 			bulk->bk_iovs[i].kiov_offset = 0;
-			bulk->bk_iovs[i].kiov_len    = len;
-			bulk->bk_iovs[i].kiov_page   =
+			bulk->bk_iovs[i].kiov_len = len;
+			bulk->bk_iovs[i].kiov_page =
 				alloc_page(GFP_KERNEL);
 
 			if (!bulk->bk_iovs[i].kiov_page) {
@@ -882,13 +882,13 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 		}
 
 		trq->tsr_ndest = test->tes_span;
-		trq->tsr_loop  = test->tes_loop;
+		trq->tsr_loop = test->tes_loop;
 	}
 
-	trq->tsr_sid        = console_session.ses_id;
-	trq->tsr_bid        = test->tes_hdr.tsb_id;
-	trq->tsr_concur     = test->tes_concur;
-	trq->tsr_is_client  = (transop == LST_TRANS_TSBCLIADD) ? 1 : 0;
+	trq->tsr_sid = console_session.ses_id;
+	trq->tsr_bid = test->tes_hdr.tsb_id;
+	trq->tsr_concur = test->tes_concur;
+	trq->tsr_is_client = (transop == LST_TRANS_TSBCLIADD) ? 1 : 0;
 	trq->tsr_stop_onerr = !!test->tes_stop_onerr;
 
 	switch (test->tes_type) {
@@ -1262,7 +1262,7 @@ lstcon_rpc_pinger(void *arg)
 
 		drq = &crpc->crp_rpc->crpc_reqstmsg.msg_body.dbg_reqst;
 
-		drq->dbg_sid   = console_session.ses_id;
+		drq->dbg_sid = console_session.ses_id;
 		drq->dbg_flags = 0;
 
 		lstcon_rpc_trans_addreq(trans, crpc);
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index aac159b..15cd830 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -97,8 +97,8 @@ lstcon_node_find(lnet_process_id_t id, lstcon_node_t **ndpp, int create)
 
 	ndl->ndl_node = *ndpp;
 
-	ndl->ndl_node->nd_ref   = 1;
-	ndl->ndl_node->nd_id    = id;
+	ndl->ndl_node->nd_ref = 1;
+	ndl->ndl_node->nd_id = id;
 	ndl->ndl_node->nd_stamp = cfs_time_current();
 	ndl->ndl_node->nd_state = LST_NODE_UNKNOWN;
 	ndl->ndl_node->nd_timeout = 0;
@@ -179,7 +179,7 @@ lstcon_ndlink_find(struct list_head *hash,
 	INIT_LIST_HEAD(&ndl->ndl_link);
 	list_add_tail(&ndl->ndl_hlink, &hash[idx]);
 
-	return  0;
+	return 0;
 }
 
 static void
@@ -978,8 +978,8 @@ lstcon_batch_info(char *name, lstcon_test_batch_ent_t __user *ent_up,
 		entp->u.tbe_batch.bae_state = bat->bat_state;
 
 	} else {
-		entp->u.tbe_test.tse_type   = test->tes_type;
-		entp->u.tbe_test.tse_loop   = test->tes_loop;
+		entp->u.tbe_test.tse_type = test->tes_type;
+		entp->u.tbe_test.tse_loop = test->tes_loop;
 		entp->u.tbe_test.tse_concur = test->tes_concur;
 	}
 
@@ -1196,7 +1196,7 @@ lstcon_test_nodes_add(lstcon_test_t *test, struct list_head __user *result_up)
 	LASSERT(test->tes_dst_grp);
 
 	transop = LST_TRANS_TSBSRVADD;
-	grp  = test->tes_dst_grp;
+	grp = test->tes_dst_grp;
 again:
 	rc = lstcon_rpc_trans_ndlist(&grp->grp_ndl_list,
 				     &test->tes_trans_list, transop,
@@ -1317,18 +1317,18 @@ lstcon_test_add(char *batch_name, int type, int loop,
 		goto out;
 	}
 
-	test->tes_hdr.tsb_id	= batch->bat_hdr.tsb_id;
-	test->tes_batch		= batch;
-	test->tes_type		= type;
-	test->tes_oneside	= 0; /* TODO */
-	test->tes_loop		= loop;
-	test->tes_concur	= concur;
-	test->tes_stop_onerr	= 1; /* TODO */
-	test->tes_span		= span;
-	test->tes_dist		= dist;
-	test->tes_cliidx	= 0; /* just used for creating RPC */
-	test->tes_src_grp	= src_grp;
-	test->tes_dst_grp	= dst_grp;
+	test->tes_hdr.tsb_id = batch->bat_hdr.tsb_id;
+	test->tes_batch	= batch;
+	test->tes_type = type;
+	test->tes_oneside = 0; /* TODO */
+	test->tes_loop = loop;
+	test->tes_concur = concur;
+	test->tes_stop_onerr = 1; /* TODO */
+	test->tes_span = span;
+	test->tes_dist = dist;
+	test->tes_cliidx = 0; /* just used for creating RPC */
+	test->tes_src_grp = src_grp;
+	test->tes_dst_grp = dst_grp;
 	INIT_LIST_HEAD(&test->tes_trans_list);
 
 	if (param) {
@@ -1420,8 +1420,8 @@ lstcon_test_batch_query(char *name, int testidx, int client,
 
 	if (!testidx) {
 		translist = &batch->bat_trans_list;
-		ndlist    = &batch->bat_cli_list;
-		hdr       = &batch->bat_hdr;
+		ndlist = &batch->bat_cli_list;
+		hdr = &batch->bat_hdr;
 
 	} else {
 		/* query specified test only */
@@ -1432,8 +1432,8 @@ lstcon_test_batch_query(char *name, int testidx, int client,
 		}
 
 		translist = &test->tes_trans_list;
-		ndlist    = &test->tes_src_grp->grp_ndl_list;
-		hdr       = &test->tes_hdr;
+		ndlist = &test->tes_src_grp->grp_ndl_list;
+		hdr = &test->tes_hdr;
 	}
 
 	transop = client ? LST_TRANS_TSBCLIQRY : LST_TRANS_TSBSRVQRY;
@@ -1689,7 +1689,7 @@ lstcon_nodes_debug(int timeout,
 int
 lstcon_session_match(lst_sid_t sid)
 {
-	return (console_session.ses_id.ses_nid   == sid.ses_nid &&
+	return (console_session.ses_id.ses_nid == sid.ses_nid &&
 		console_session.ses_id.ses_stamp == sid.ses_stamp) ?  1 : 0;
 }
 
@@ -1701,7 +1701,7 @@ lstcon_new_session_id(lst_sid_t *sid)
 	LASSERT(console_session.ses_state == LST_SESSION_NONE);
 
 	LNetGetId(1, &id);
-	sid->ses_nid   = id.nid;
+	sid->ses_nid = id.nid;
 	sid->ses_stamp = cfs_time_current();
 }
 
@@ -1839,9 +1839,9 @@ lstcon_session_end(void)
 	/* waiting for orphan rpcs to die */
 	lstcon_rpc_cleanup_wait();
 
-	console_session.ses_id    = LST_INVALID_SID;
+	console_session.ses_id = LST_INVALID_SID;
 	console_session.ses_state = LST_SESSION_NONE;
-	console_session.ses_key   = 0;
+	console_session.ses_key = 0;
 	console_session.ses_force = 0;
 	console_session.ses_feats_updated = 0;
 
@@ -1866,7 +1866,7 @@ lstcon_session_end(void)
 	LASSERT(list_empty(&console_session.ses_ndl_list));
 
 	console_session.ses_shutdown = 0;
-	console_session.ses_expired  = 0;
+	console_session.ses_expired = 0;
 
 	return rc;
 }
@@ -1965,7 +1965,7 @@ lstcon_acceptor_handle(struct srpc_server_rpc *rpc)
 		goto out;
 	}
 
-	ndl->ndl_node->nd_state   = LST_NODE_ACTIVE;
+	ndl->ndl_node->nd_state = LST_NODE_ACTIVE;
 	ndl->ndl_node->nd_timeout = console_session.ses_timeout;
 
 	if (!grp->grp_userland)
@@ -1974,7 +1974,7 @@ lstcon_acceptor_handle(struct srpc_server_rpc *rpc)
 	strlcpy(jrep->join_session, console_session.ses_name,
 		sizeof(jrep->join_session));
 	jrep->join_timeout = console_session.ses_timeout;
-	jrep->join_status  = 0;
+	jrep->join_status = 0;
 
 out:
 	rep->msg_ses_feats = console_session.ses_features;
@@ -1990,9 +1990,9 @@ static srpc_service_t lstcon_acceptor_service;
 static void lstcon_init_acceptor_service(void)
 {
 	/* initialize selftest console acceptor service table */
-	lstcon_acceptor_service.sv_name     = "join session";
-	lstcon_acceptor_service.sv_handler  = lstcon_acceptor_handle;
-	lstcon_acceptor_service.sv_id       = SRPC_SERVICE_JOIN;
+	lstcon_acceptor_service.sv_name = "join session";
+	lstcon_acceptor_service.sv_handler = lstcon_acceptor_handle;
+	lstcon_acceptor_service.sv_id = SRPC_SERVICE_JOIN;
 	lstcon_acceptor_service.sv_wi_total = SFW_FRWK_WI_MAX;
 }
 
@@ -2009,14 +2009,14 @@ lstcon_console_init(void)
 
 	memset(&console_session, 0, sizeof(struct lstcon_session));
 
-	console_session.ses_id		  = LST_INVALID_SID;
-	console_session.ses_state	  = LST_SESSION_NONE;
-	console_session.ses_timeout	  = 0;
-	console_session.ses_force	  = 0;
-	console_session.ses_expired	  = 0;
+	console_session.ses_id = LST_INVALID_SID;
+	console_session.ses_state = LST_SESSION_NONE;
+	console_session.ses_timeout = 0;
+	console_session.ses_force = 0;
+	console_session.ses_expired = 0;
 	console_session.ses_feats_updated = 0;
-	console_session.ses_features	  = LST_FEATS_MASK;
-	console_session.ses_laststamp	  = ktime_get_real_seconds();
+	console_session.ses_features = LST_FEATS_MASK;
+	console_session.ses_laststamp = ktime_get_real_seconds();
 
 	mutex_init(&console_session.ses_mutex);
 
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index 04bab32..a3ccd78 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -149,7 +149,7 @@ sfw_register_test(srpc_service_t *service, sfw_test_client_ops_t *cliops)
 	if (!tsc)
 		return -ENOMEM;
 
-	tsc->tsc_cli_ops     = cliops;
+	tsc->tsc_cli_ops = cliops;
 	tsc->tsc_srv_service = service;
 
 	list_add_tail(&tsc->tsc_list, &sfw_data.fw_tests);
@@ -271,10 +271,10 @@ sfw_init_session(sfw_session_t *sn, lst_sid_t sid,
 	strlcpy(&sn->sn_name[0], name, sizeof(sn->sn_name));
 
 	sn->sn_timer_active = 0;
-	sn->sn_id           = sid;
-	sn->sn_features	    = features;
-	sn->sn_timeout      = session_timeout;
-	sn->sn_started      = cfs_time_current();
+	sn->sn_id = sid;
+	sn->sn_features = features;
+	sn->sn_timeout = session_timeout;
+	sn->sn_started = cfs_time_current();
 
 	timer->stt_data = sn;
 	timer->stt_func = sfw_session_expired;
@@ -350,9 +350,9 @@ sfw_bid2batch(lst_bid_t bid)
 	if (!bat)
 		return NULL;
 
-	bat->bat_error    = 0;
-	bat->bat_session  = sn;
-	bat->bat_id       = bid;
+	bat->bat_error = 0;
+	bat->bat_session = sn;
+	bat->bat_id = bid;
 	atomic_set(&bat->bat_nactive, 0);
 	INIT_LIST_HEAD(&bat->bat_tests);
 
@@ -386,9 +386,9 @@ sfw_get_stats(srpc_stat_reqst_t *request, srpc_stat_reply_t *reply)
 	 * send over the msecs since the session was started
 	 * with 32 bits to send, this is ~49 days
 	 */
-	cnt->running_ms	     = jiffies_to_msecs(jiffies - sn->sn_started);
-	cnt->brw_errors      = atomic_read(&sn->sn_brw_errors);
-	cnt->ping_errors     = atomic_read(&sn->sn_ping_errors);
+	cnt->running_ms = jiffies_to_msecs(jiffies - sn->sn_started);
+	cnt->brw_errors = atomic_read(&sn->sn_brw_errors);
+	cnt->ping_errors = atomic_read(&sn->sn_ping_errors);
 	cnt->zombie_sessions = atomic_read(&sfw_data.fw_nzombies);
 
 	cnt->active_batches = 0;
@@ -416,8 +416,8 @@ sfw_make_session(srpc_mksn_reqst_t *request, srpc_mksn_reply_t *reply)
 	}
 
 	if (sn) {
-		reply->mksn_status  = 0;
-		reply->mksn_sid     = sn->sn_id;
+		reply->mksn_status = 0;
+		reply->mksn_sid = sn->sn_id;
 		reply->mksn_timeout = sn->sn_timeout;
 
 		if (sfw_sid_equal(request->mksn_sid, sn->sn_id)) {
@@ -466,8 +466,8 @@ sfw_make_session(srpc_mksn_reqst_t *request, srpc_mksn_reply_t *reply)
 
 	spin_unlock(&sfw_data.fw_lock);
 
-	reply->mksn_status  = 0;
-	reply->mksn_sid     = sn->sn_id;
+	reply->mksn_status = 0;
+	reply->mksn_sid = sn->sn_id;
 	reply->mksn_timeout = sn->sn_timeout;
 	return 0;
 }
@@ -499,7 +499,7 @@ sfw_remove_session(srpc_rmsn_reqst_t *request, srpc_rmsn_reply_t *reply)
 	spin_unlock(&sfw_data.fw_lock);
 
 	reply->rmsn_status = 0;
-	reply->rmsn_sid    = LST_INVALID_SID;
+	reply->rmsn_sid = LST_INVALID_SID;
 	LASSERT(!sfw_data.fw_session);
 	return 0;
 }
@@ -511,12 +511,12 @@ sfw_debug_session(srpc_debug_reqst_t *request, srpc_debug_reply_t *reply)
 
 	if (!sn) {
 		reply->dbg_status = ESRCH;
-		reply->dbg_sid    = LST_INVALID_SID;
+		reply->dbg_sid = LST_INVALID_SID;
 		return 0;
 	}
 
-	reply->dbg_status  = 0;
-	reply->dbg_sid     = sn->sn_id;
+	reply->dbg_status = 0;
+	reply->dbg_sid = sn->sn_id;
 	reply->dbg_timeout = sn->sn_timeout;
 	if (strlcpy(reply->dbg_name, &sn->sn_name[0], sizeof(reply->dbg_name))
 	    >= sizeof(reply->dbg_name))
@@ -753,12 +753,12 @@ sfw_add_test_instance(sfw_batch_t *tsb, struct srpc_server_rpc *rpc)
 	INIT_LIST_HEAD(&tsi->tsi_free_rpcs);
 	INIT_LIST_HEAD(&tsi->tsi_active_rpcs);
 
-	tsi->tsi_stopping      = 0;
-	tsi->tsi_batch         = tsb;
-	tsi->tsi_loop          = req->tsr_loop;
-	tsi->tsi_concur        = req->tsr_concur;
-	tsi->tsi_service       = req->tsr_service;
-	tsi->tsi_is_client     = !!(req->tsr_is_client);
+	tsi->tsi_stopping = 0;
+	tsi->tsi_batch = tsb;
+	tsi->tsi_loop = req->tsr_loop;
+	tsi->tsi_concur = req->tsr_concur;
+	tsi->tsi_service = req->tsr_service;
+	tsi->tsi_is_client = !!(req->tsr_is_client);
 	tsi->tsi_stoptsu_onerr = !!(req->tsr_stop_onerr);
 
 	rc = sfw_load_test(tsi);
@@ -806,7 +806,7 @@ sfw_add_test_instance(sfw_batch_t *tsb, struct srpc_server_rpc *rpc)
 			tsu->tsu_dest.nid = id.nid;
 			tsu->tsu_dest.pid = id.pid;
 			tsu->tsu_instance = tsi;
-			tsu->tsu_private  = NULL;
+			tsu->tsu_private = NULL;
 			list_add_tail(&tsu->tsu_list, &tsi->tsi_units);
 		}
 	}
@@ -1269,7 +1269,7 @@ sfw_handle_server_rpc(struct srpc_server_rpc *rpc)
 			CNETERR("Features of framework RPC don't match features of current session: %x/%x\n",
 				request->msg_ses_feats, sn->sn_features);
 			reply->msg_body.reply.status = EPROTO;
-			reply->msg_body.reply.sid    = sn->sn_id;
+			reply->msg_body.reply.sid = sn->sn_id;
 			goto out;
 		}
 
@@ -1652,7 +1652,7 @@ sfw_startup(void)
 
 	memset(&sfw_data, 0, sizeof(struct smoketest_framework));
 
-	sfw_data.fw_session     = NULL;
+	sfw_data.fw_session = NULL;
 	sfw_data.fw_active_srpc = NULL;
 	spin_lock_init(&sfw_data.fw_lock);
 	atomic_set(&sfw_data.fw_nzombies, 0);
@@ -1689,8 +1689,8 @@ sfw_startup(void)
 			break;
 
 		sv->sv_bulk_ready = NULL;
-		sv->sv_handler    = sfw_handle_server_rpc;
-		sv->sv_wi_total   = SFW_FRWK_WI_MAX;
+		sv->sv_handler = sfw_handle_server_rpc;
+		sv->sv_wi_total = SFW_FRWK_WI_MAX;
 		if (sv->sv_id == SRPC_SERVICE_TEST)
 			sv->sv_bulk_ready = sfw_bulk_ready;
 
diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c b/drivers/staging/lustre/lnet/selftest/ping_test.c
index b5e69a7..cb2707a 100644
--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
@@ -111,7 +111,7 @@ ping_client_prep_rpc(sfw_test_unit_t *tsu,
 	spin_unlock(&lst_ping_data.pnd_lock);
 
 	ktime_get_real_ts64(&ts);
-	req->pnr_time_sec  = ts.tv_sec;
+	req->pnr_time_sec = ts.tv_sec;
 	req->pnr_time_usec = ts.tv_nsec / NSEC_PER_USEC;
 
 	return rc;
@@ -194,7 +194,7 @@ ping_server_handle(struct srpc_server_rpc *rpc)
 		return -EINVAL;
 	}
 
-	rep->pnr_seq   = req->pnr_seq;
+	rep->pnr_seq = req->pnr_seq;
 	rep->pnr_magic = LST_PING_TEST_MAGIC;
 
 	if (reqstmsg->msg_ses_feats & ~LST_FEATS_MASK) {
@@ -213,8 +213,8 @@ ping_server_handle(struct srpc_server_rpc *rpc)
 sfw_test_client_ops_t 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_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;
 }
@@ -222,8 +222,8 @@ void ping_init_test_client(void)
 srpc_service_t ping_test_service;
 void ping_init_test_service(void)
 {
-	ping_test_service.sv_id       = SRPC_SERVICE_PING;
-	ping_test_service.sv_name     = "ping_test";
-	ping_test_service.sv_handler  = ping_server_handle;
+	ping_test_service.sv_id = SRPC_SERVICE_PING;
+	ping_test_service.sv_name = "ping_test";
+	ping_test_service.sv_handler = ping_server_handle;
 	ping_test_service.sv_wi_total = ping_srv_workitems;
 }
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index 1af978f..f344d56 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -96,8 +96,8 @@ srpc_add_bulk_page(srpc_bulk_t *bk, struct page *pg, int i, int nob)
 	LASSERT(i >= 0 && i < bk->bk_niov);
 
 	bk->bk_iovs[i].kiov_offset = 0;
-	bk->bk_iovs[i].kiov_page   = pg;
-	bk->bk_iovs[i].kiov_len    = nob;
+	bk->bk_iovs[i].kiov_page = pg;
+	bk->bk_iovs[i].kiov_len = nob;
 	return nob;
 }
 
@@ -136,9 +136,9 @@ srpc_alloc_bulk(int cpt, unsigned bulk_npg, unsigned bulk_len, int sink)
 	}
 
 	memset(bk, 0, offsetof(srpc_bulk_t, bk_iovs[bulk_npg]));
-	bk->bk_sink   = sink;
-	bk->bk_len    = bulk_len;
-	bk->bk_niov   = bulk_npg;
+	bk->bk_sink = sink;
+	bk->bk_len = bulk_len;
+	bk->bk_niov = bulk_npg;
 
 	for (i = 0; i < bulk_npg; i++) {
 		struct page *pg;
@@ -182,10 +182,10 @@ srpc_init_server_rpc(struct srpc_server_rpc *rpc,
 
 	rpc->srpc_ev.ev_fired = 1; /* no event expected now */
 
-	rpc->srpc_scd      = scd;
+	rpc->srpc_scd = scd;
 	rpc->srpc_reqstbuf = buffer;
-	rpc->srpc_peer     = buffer->buf_peer;
-	rpc->srpc_self     = buffer->buf_self;
+	rpc->srpc_peer = buffer->buf_peer;
+	rpc->srpc_self = buffer->buf_self;
 	LNetInvalidateHandle(&rpc->srpc_replymdh);
 }
 
@@ -372,10 +372,10 @@ srpc_post_passive_rdma(int portal, int local, __u64 matchbits, void *buf,
 	}
 
 	md.threshold = 1;
-	md.user_ptr  = ev;
-	md.start     = buf;
-	md.length    = len;
-	md.options   = options;
+	md.user_ptr = ev;
+	md.start = buf;
+	md.length = len;
+	md.options = options;
 	md.eq_handle = srpc_data.rpc_lnet_eq;
 
 	rc = LNetMDAttach(meh, md, LNET_UNLINK, mdh);
@@ -401,12 +401,12 @@ srpc_post_active_rdma(int portal, __u64 matchbits, void *buf, int len,
 	int rc;
 	lnet_md_t md;
 
-	md.user_ptr  = ev;
-	md.start     = buf;
-	md.length    = len;
+	md.user_ptr = ev;
+	md.start = buf;
+	md.length = len;
 	md.eq_handle = srpc_data.rpc_lnet_eq;
 	md.threshold = options & LNET_MD_OP_GET ? 2 : 1;
-	md.options   = options & ~(LNET_MD_OP_PUT | LNET_MD_OP_GET);
+	md.options = options & ~(LNET_MD_OP_PUT | LNET_MD_OP_GET);
 
 	rc = LNetMDBind(md, LNET_UNLINK, mdh);
 	if (rc) {
@@ -798,8 +798,8 @@ srpc_send_request(srpc_client_rpc_t *rpc)
 	int rc;
 
 	ev->ev_fired = 0;
-	ev->ev_data  = rpc;
-	ev->ev_type  = SRPC_REQUEST_SENT;
+	ev->ev_data = rpc;
+	ev->ev_type = SRPC_REQUEST_SENT;
 
 	 rc = srpc_post_active_rdma(srpc_serv_portal(rpc->crpc_service),
 				    rpc->crpc_service, &rpc->crpc_reqstmsg,
@@ -821,8 +821,8 @@ srpc_prepare_reply(srpc_client_rpc_t *rpc)
 	int rc;
 
 	ev->ev_fired = 0;
-	ev->ev_data  = rpc;
-	ev->ev_type  = SRPC_REPLY_RCVD;
+	ev->ev_data = rpc;
+	ev->ev_type = SRPC_REPLY_RCVD;
 
 	*id = srpc_next_id();
 
@@ -855,8 +855,8 @@ srpc_prepare_bulk(srpc_client_rpc_t *rpc)
 	opt |= LNET_MD_KIOV;
 
 	ev->ev_fired = 0;
-	ev->ev_data  = rpc;
-	ev->ev_type  = SRPC_BULK_REQ_RCVD;
+	ev->ev_data = rpc;
+	ev->ev_type = SRPC_BULK_REQ_RCVD;
 
 	*id = srpc_next_id();
 
@@ -885,8 +885,8 @@ srpc_do_bulk(struct srpc_server_rpc *rpc)
 	opt |= LNET_MD_KIOV;
 
 	ev->ev_fired = 0;
-	ev->ev_data  = rpc;
-	ev->ev_type  = bk->bk_sink ? SRPC_BULK_GET_RPLD : SRPC_BULK_PUT_SENT;
+	ev->ev_data = rpc;
+	ev->ev_type = bk->bk_sink ? SRPC_BULK_GET_RPLD : SRPC_BULK_PUT_SENT;
 
 	rc = srpc_post_active_rdma(SRPC_RDMA_PORTAL, id,
 				   &bk->bk_iovs[0], bk->bk_niov, opt,
@@ -1104,8 +1104,8 @@ srpc_add_client_rpc_timer(srpc_client_rpc_t *rpc)
 		return;
 
 	INIT_LIST_HEAD(&timer->stt_list);
-	timer->stt_data    = rpc;
-	timer->stt_func    = srpc_client_rpc_expired;
+	timer->stt_data = rpc;
+	timer->stt_func = srpc_client_rpc_expired;
 	timer->stt_expires = ktime_get_real_seconds() + rpc->crpc_timeout;
 	stt_add_timer(timer);
 }
@@ -1341,7 +1341,7 @@ srpc_abort_rpc(srpc_client_rpc_t *rpc, int why)
 	       swi_state2str(rpc->crpc_wi.swi_state), why);
 
 	rpc->crpc_aborted = 1;
-	rpc->crpc_status  = why;
+	rpc->crpc_status = why;
 	swi_schedule_workitem(&rpc->crpc_wi);
 }
 
@@ -1389,12 +1389,12 @@ srpc_send_reply(struct srpc_server_rpc *rpc)
 	spin_unlock(&scd->scd_lock);
 
 	ev->ev_fired = 0;
-	ev->ev_data  = rpc;
-	ev->ev_type  = SRPC_REPLY_SENT;
+	ev->ev_data = rpc;
+	ev->ev_type = SRPC_REPLY_SENT;
 
-	msg->msg_magic   = SRPC_MSG_MAGIC;
+	msg->msg_magic = SRPC_MSG_MAGIC;
 	msg->msg_version = SRPC_MSG_VERSION;
-	msg->msg_type    = srpc_service2reply(sv->sv_id);
+	msg->msg_type = srpc_service2reply(sv->sv_id);
 
 	rc = srpc_post_active_rdma(SRPC_RDMA_PORTAL, rpyid, msg,
 				   sizeof(*msg), LNET_MD_OP_PUT,
@@ -1464,7 +1464,7 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
 		spin_lock(&crpc->crpc_lock);
 
 		LASSERT(!rpcev->ev_fired);
-		rpcev->ev_fired  = 1;
+		rpcev->ev_fired = 1;
 		rpcev->ev_status = (ev->type == LNET_EVENT_UNLINK) ?
 						-EINTR : ev->status;
 		swi_schedule_workitem(&crpc->crpc_wi);
@@ -1582,13 +1582,13 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
 		}
 	case SRPC_REPLY_SENT:
 		srpc = rpcev->ev_data;
-		scd  = srpc->srpc_scd;
+		scd = srpc->srpc_scd;
 
 		LASSERT(rpcev == &srpc->srpc_ev);
 
 		spin_lock(&scd->scd_lock);
 
-		rpcev->ev_fired  = 1;
+		rpcev->ev_fired = 1;
 		rpcev->ev_status = (ev->type == LNET_EVENT_UNLINK) ?
 				   -EINTR : ev->status;
 		swi_schedule_workitem(&srpc->srpc_wi);
diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h
index b605f7f..7a22bd3 100644
--- a/drivers/staging/lustre/lnet/selftest/selftest.h
+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
@@ -472,9 +472,9 @@ static inline void
 swi_init_workitem(swi_workitem_t *swi, void *data,
 		  swi_action_t action, struct cfs_wi_sched *sched)
 {
-	swi->swi_sched  = sched;
+	swi->swi_sched = sched;
 	swi->swi_action = action;
-	swi->swi_state  = SWI_STATE_NEWBORN;
+	swi->swi_state = SWI_STATE_NEWBORN;
 	cfs_wi_init(&swi->swi_workitem, data, swi_wi_action);
 }
 
@@ -531,13 +531,13 @@ srpc_init_client_rpc(srpc_client_rpc_t *rpc, lnet_process_id_t peer,
 	spin_lock_init(&rpc->crpc_lock);
 	atomic_set(&rpc->crpc_refcount, 1); /* 1 ref for caller */
 
-	rpc->crpc_dest         = peer;
-	rpc->crpc_priv         = priv;
-	rpc->crpc_service      = service;
-	rpc->crpc_bulk.bk_len  = bulklen;
+	rpc->crpc_dest = peer;
+	rpc->crpc_priv = priv;
+	rpc->crpc_service = service;
+	rpc->crpc_bulk.bk_len = bulklen;
 	rpc->crpc_bulk.bk_niov = nbulkiov;
-	rpc->crpc_done         = rpc_done;
-	rpc->crpc_fini         = rpc_fini;
+	rpc->crpc_done = rpc_done;
+	rpc->crpc_fini = rpc_fini;
 	LNetInvalidateHandle(&rpc->crpc_reqstmdh);
 	LNetInvalidateHandle(&rpc->crpc_replymdh);
 	LNetInvalidateHandle(&rpc->crpc_bulk.bk_mdh);
@@ -547,9 +547,9 @@ srpc_init_client_rpc(srpc_client_rpc_t *rpc, lnet_process_id_t peer,
 	rpc->crpc_reqstev.ev_fired = 1;
 	rpc->crpc_replyev.ev_fired = 1;
 
-	rpc->crpc_reqstmsg.msg_magic   = SRPC_MSG_MAGIC;
+	rpc->crpc_reqstmsg.msg_magic = SRPC_MSG_MAGIC;
 	rpc->crpc_reqstmsg.msg_version = SRPC_MSG_VERSION;
-	rpc->crpc_reqstmsg.msg_type    = srpc_service2request(service);
+	rpc->crpc_reqstmsg.msg_type = srpc_service2request(service);
 }
 
 static inline const char *
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 05/10] staging: lustre: remove extra spacing when setting variable for lnet selftest
@ 2016-03-12  1:29   ` James Simmons
  0 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

Remove any extra spacing for the lines of code setting variables to
some value.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/brw_test.c  |   40 ++++++------
 drivers/staging/lustre/lnet/selftest/conrpc.c    |   68 ++++++++++----------
 drivers/staging/lustre/lnet/selftest/console.c   |   78 +++++++++++-----------
 drivers/staging/lustre/lnet/selftest/framework.c |   60 ++++++++--------
 drivers/staging/lustre/lnet/selftest/ping_test.c |   14 ++--
 drivers/staging/lustre/lnet/selftest/rpc.c       |   68 ++++++++++----------
 drivers/staging/lustre/lnet/selftest/selftest.h  |   20 +++---
 7 files changed, 174 insertions(+), 174 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c
index 6b1f983..0d0c22c 100644
--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -83,14 +83,14 @@ brw_client_init(sfw_test_instance_t *tsi)
 	if (!(sn->sn_features & LST_FEAT_BULK_LEN)) {
 		test_bulk_req_t *breq = &tsi->tsi_u.bulk_v0;
 
-		opc   = breq->blk_opc;
+		opc = breq->blk_opc;
 		flags = breq->blk_flags;
-		npg   = breq->blk_npg;
+		npg = breq->blk_npg;
 		/*
 		 * NB: this is not going to work for variable page size,
 		 * but we have to keep it for compatibility
 		 */
-		len   = npg * PAGE_CACHE_SIZE;
+		len = npg * PAGE_CACHE_SIZE;
 
 	} else {
 		test_bulk_req_v1_t *breq = &tsi->tsi_u.bulk_v1;
@@ -101,10 +101,10 @@ brw_client_init(sfw_test_instance_t *tsi)
 		 */
 		LASSERT(!(sn->sn_features & ~LST_FEATS_MASK));
 
-		opc   = breq->blk_opc;
+		opc = breq->blk_opc;
 		flags = breq->blk_flags;
-		len   = breq->blk_len;
-		npg   = (len + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+		len = breq->blk_len;
+		npg = (len + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
 	}
 
 	if (npg > LNET_MAX_IOV || npg <= 0)
@@ -275,10 +275,10 @@ brw_client_prep_rpc(sfw_test_unit_t *tsu,
 	if (!(sn->sn_features & LST_FEAT_BULK_LEN)) {
 		test_bulk_req_t *breq = &tsi->tsi_u.bulk_v0;
 
-		opc   = breq->blk_opc;
+		opc = breq->blk_opc;
 		flags = breq->blk_flags;
-		npg   = breq->blk_npg;
-		len   = npg * PAGE_CACHE_SIZE;
+		npg = breq->blk_npg;
+		len = npg * PAGE_CACHE_SIZE;
 
 	} else {
 		test_bulk_req_v1_t *breq = &tsi->tsi_u.bulk_v1;
@@ -289,10 +289,10 @@ brw_client_prep_rpc(sfw_test_unit_t *tsu,
 		 */
 		LASSERT(!(sn->sn_features & ~LST_FEATS_MASK));
 
-		opc   = breq->blk_opc;
+		opc = breq->blk_opc;
 		flags = breq->blk_flags;
-		len   = breq->blk_len;
-		npg   = (len + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+		len = breq->blk_len;
+		npg = (len + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
 	}
 
 	rc = sfw_create_test_rpc(tsu, dest, sn->sn_features, npg, len, &rpc);
@@ -307,8 +307,8 @@ brw_client_prep_rpc(sfw_test_unit_t *tsu,
 
 	req = &rpc->crpc_reqstmsg.msg_body.brw_reqst;
 	req->brw_flags = flags;
-	req->brw_rw    = opc;
-	req->brw_len   = len;
+	req->brw_rw = opc;
+	req->brw_len = len;
 
 	*rpcpp = rpc;
 	return 0;
@@ -493,8 +493,8 @@ brw_server_handle(struct srpc_server_rpc *rpc)
 sfw_test_client_ops_t brw_test_client;
 void brw_init_test_client(void)
 {
-	brw_test_client.tso_init     = brw_client_init;
-	brw_test_client.tso_fini     = brw_client_fini;
+	brw_test_client.tso_init = brw_client_init;
+	brw_test_client.tso_fini = brw_client_fini;
 	brw_test_client.tso_prep_rpc = brw_client_prep_rpc;
 	brw_test_client.tso_done_rpc = brw_client_done_rpc;
 };
@@ -502,9 +502,9 @@ void brw_init_test_client(void)
 srpc_service_t brw_test_service;
 void brw_init_test_service(void)
 {
-	brw_test_service.sv_id         = SRPC_SERVICE_BRW;
-	brw_test_service.sv_name       = "brw_test";
-	brw_test_service.sv_handler    = brw_server_handle;
+	brw_test_service.sv_id = SRPC_SERVICE_BRW;
+	brw_test_service.sv_name = "brw_test";
+	brw_test_service.sv_handler = brw_server_handle;
 	brw_test_service.sv_bulk_ready = brw_bulk_ready;
-	brw_test_service.sv_wi_total   = brw_srv_workitems;
+	brw_test_service.sv_wi_total = brw_srv_workitems;
 }
diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index 77ea41b..cdb660e 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -78,7 +78,7 @@ lstcon_rpc_done(srpc_client_rpc_t *rpc)
 		/* not aborted */
 		LASSERT(!crpc->crp_status);
 
-		crpc->crp_stamp  = cfs_time_current();
+		crpc->crp_stamp = cfs_time_current();
 		crpc->crp_status = rpc->crpc_status;
 	}
 
@@ -99,13 +99,13 @@ lstcon_rpc_init(lstcon_node_t *nd, int service, unsigned feats,
 	if (!crpc->crp_rpc)
 		return -ENOMEM;
 
-	crpc->crp_trans    = NULL;
-	crpc->crp_node     = nd;
-	crpc->crp_posted   = 0;
+	crpc->crp_trans = NULL;
+	crpc->crp_node = nd;
+	crpc->crp_posted = 0;
 	crpc->crp_finished = 0;
 	crpc->crp_unpacked = 0;
-	crpc->crp_status   = 0;
-	crpc->crp_stamp    = 0;
+	crpc->crp_status = 0;
+	crpc->crp_stamp = 0;
 	crpc->crp_embedded = embedded;
 	INIT_LIST_HEAD(&crpc->crp_link);
 
@@ -306,7 +306,7 @@ lstcon_rpc_trans_abort(lstcon_rpc_trans_t *trans, int error)
 			continue;
 		}
 
-		crpc->crp_stamp  = cfs_time_current();
+		crpc->crp_stamp = cfs_time_current();
 		crpc->crp_status = error;
 
 		spin_unlock(&rpc->crpc_lock);
@@ -571,7 +571,7 @@ lstcon_rpc_trans_destroy(lstcon_rpc_trans_t *trans)
 		 */
 		LASSERT(crpc->crp_status);
 
-		crpc->crp_node  = NULL;
+		crpc->crp_node = NULL;
 		crpc->crp_trans = NULL;
 		list_del_init(&crpc->crp_link);
 		count++;
@@ -609,8 +609,8 @@ lstcon_sesrpc_prep(lstcon_node_t *nd, int transop,
 			return rc;
 
 		msrq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.mksn_reqst;
-		msrq->mksn_sid     = console_session.ses_id;
-		msrq->mksn_force   = console_session.ses_force;
+		msrq->mksn_sid = console_session.ses_id;
+		msrq->mksn_force = console_session.ses_force;
 		strlcpy(msrq->mksn_name, console_session.ses_name,
 			sizeof(msrq->mksn_name));
 		break;
@@ -644,7 +644,7 @@ lstcon_dbgrpc_prep(lstcon_node_t *nd, unsigned feats, lstcon_rpc_t **crpc)
 
 	drq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.dbg_reqst;
 
-	drq->dbg_sid   = console_session.ses_id;
+	drq->dbg_sid = console_session.ses_id;
 	drq->dbg_flags = 0;
 
 	return rc;
@@ -664,10 +664,10 @@ lstcon_batrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 
 	brq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.bat_reqst;
 
-	brq->bar_sid     = console_session.ses_id;
-	brq->bar_bid     = tsb->tsb_id;
+	brq->bar_sid = console_session.ses_id;
+	brq->bar_bid = tsb->tsb_id;
 	brq->bar_testidx = tsb->tsb_index;
-	brq->bar_opc     = transop == LST_TRANS_TSBRUN ? SRPC_BATCH_OPC_RUN :
+	brq->bar_opc = transop == LST_TRANS_TSBRUN ? SRPC_BATCH_OPC_RUN :
 			   (transop == LST_TRANS_TSBSTOP ? SRPC_BATCH_OPC_STOP :
 			    SRPC_BATCH_OPC_QUERY);
 
@@ -695,7 +695,7 @@ lstcon_statrpc_prep(lstcon_node_t *nd, unsigned feats, lstcon_rpc_t **crpc)
 
 	srq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.stat_reqst;
 
-	srq->str_sid  = console_session.ses_id;
+	srq->str_sid = console_session.ses_id;
 	srq->str_type = 0; /* XXX remove it */
 
 	return 0;
@@ -735,7 +735,7 @@ lstcon_dstnodes_prep(lstcon_group_t *grp, int idx,
 		return -EINVAL;
 
 	start = ((idx / dist) * span) % grp->grp_nnode;
-	end   = ((idx / dist) * span + span - 1) % grp->grp_nnode;
+	end = ((idx / dist) * span + span - 1) % grp->grp_nnode;
 
 	list_for_each_entry(ndl, &grp->grp_ndl_list, ndl_link) {
 		nd = ndl->ndl_node;
@@ -775,7 +775,7 @@ lstcon_pingrpc_prep(lst_test_ping_param_t *param, srpc_test_reqst_t *req)
 {
 	test_ping_req_t *prq = &req->tsr_u.ping;
 
-	prq->png_size  = param->png_size;
+	prq->png_size = param->png_size;
 	prq->png_flags = param->png_flags;
 	/* TODO dest */
 	return 0;
@@ -786,9 +786,9 @@ lstcon_bulkrpc_v0_prep(lst_test_bulk_param_t *param, srpc_test_reqst_t *req)
 {
 	test_bulk_req_t *brq = &req->tsr_u.bulk_v0;
 
-	brq->blk_opc   = param->blk_opc;
-	brq->blk_npg   = (param->blk_size + PAGE_CACHE_SIZE - 1) /
-			  PAGE_CACHE_SIZE;
+	brq->blk_opc = param->blk_opc;
+	brq->blk_npg = (param->blk_size + PAGE_CACHE_SIZE - 1) /
+			PAGE_CACHE_SIZE;
 	brq->blk_flags = param->blk_flags;
 
 	return 0;
@@ -799,9 +799,9 @@ lstcon_bulkrpc_v1_prep(lst_test_bulk_param_t *param, srpc_test_reqst_t *req)
 {
 	test_bulk_req_v1_t *brq = &req->tsr_u.bulk_v1;
 
-	brq->blk_opc	= param->blk_opc;
-	brq->blk_flags	= param->blk_flags;
-	brq->blk_len	= param->blk_size;
+	brq->blk_opc = param->blk_opc;
+	brq->blk_flags = param->blk_flags;
+	brq->blk_len = param->blk_size;
 	brq->blk_offset	= 0; /* reserved */
 
 	return 0;
@@ -818,7 +818,7 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 	int i;
 	int npg = 0;
 	int nob = 0;
-	int rc  = 0;
+	int rc = 0;
 
 	if (transop == LST_TRANS_TSBCLIADD) {
 		npg = sfw_id_pages(test->tes_span);
@@ -831,7 +831,7 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 	if (rc)
 		return rc;
 
-	trq  = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.tes_reqst;
+	trq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.tes_reqst;
 
 	if (transop == LST_TRANS_TSBSRVADD) {
 		int ndist = (sgrp->grp_nnode + test->tes_dist - 1) /
@@ -841,7 +841,7 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 		int nmax = (ndist + nspan - 1) / nspan;
 
 		trq->tsr_ndest = 0;
-		trq->tsr_loop  = nmax * test->tes_dist * test->tes_concur;
+		trq->tsr_loop = nmax * test->tes_dist * test->tes_concur;
 
 	} else {
 		bulk = &(*crpc)->crp_rpc->crpc_bulk;
@@ -857,8 +857,8 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 			nob -= len;
 
 			bulk->bk_iovs[i].kiov_offset = 0;
-			bulk->bk_iovs[i].kiov_len    = len;
-			bulk->bk_iovs[i].kiov_page   =
+			bulk->bk_iovs[i].kiov_len = len;
+			bulk->bk_iovs[i].kiov_page =
 				alloc_page(GFP_KERNEL);
 
 			if (!bulk->bk_iovs[i].kiov_page) {
@@ -882,13 +882,13 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 		}
 
 		trq->tsr_ndest = test->tes_span;
-		trq->tsr_loop  = test->tes_loop;
+		trq->tsr_loop = test->tes_loop;
 	}
 
-	trq->tsr_sid        = console_session.ses_id;
-	trq->tsr_bid        = test->tes_hdr.tsb_id;
-	trq->tsr_concur     = test->tes_concur;
-	trq->tsr_is_client  = (transop == LST_TRANS_TSBCLIADD) ? 1 : 0;
+	trq->tsr_sid = console_session.ses_id;
+	trq->tsr_bid = test->tes_hdr.tsb_id;
+	trq->tsr_concur = test->tes_concur;
+	trq->tsr_is_client = (transop == LST_TRANS_TSBCLIADD) ? 1 : 0;
 	trq->tsr_stop_onerr = !!test->tes_stop_onerr;
 
 	switch (test->tes_type) {
@@ -1262,7 +1262,7 @@ lstcon_rpc_pinger(void *arg)
 
 		drq = &crpc->crp_rpc->crpc_reqstmsg.msg_body.dbg_reqst;
 
-		drq->dbg_sid   = console_session.ses_id;
+		drq->dbg_sid = console_session.ses_id;
 		drq->dbg_flags = 0;
 
 		lstcon_rpc_trans_addreq(trans, crpc);
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index aac159b..15cd830 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -97,8 +97,8 @@ lstcon_node_find(lnet_process_id_t id, lstcon_node_t **ndpp, int create)
 
 	ndl->ndl_node = *ndpp;
 
-	ndl->ndl_node->nd_ref   = 1;
-	ndl->ndl_node->nd_id    = id;
+	ndl->ndl_node->nd_ref = 1;
+	ndl->ndl_node->nd_id = id;
 	ndl->ndl_node->nd_stamp = cfs_time_current();
 	ndl->ndl_node->nd_state = LST_NODE_UNKNOWN;
 	ndl->ndl_node->nd_timeout = 0;
@@ -179,7 +179,7 @@ lstcon_ndlink_find(struct list_head *hash,
 	INIT_LIST_HEAD(&ndl->ndl_link);
 	list_add_tail(&ndl->ndl_hlink, &hash[idx]);
 
-	return  0;
+	return 0;
 }
 
 static void
@@ -978,8 +978,8 @@ lstcon_batch_info(char *name, lstcon_test_batch_ent_t __user *ent_up,
 		entp->u.tbe_batch.bae_state = bat->bat_state;
 
 	} else {
-		entp->u.tbe_test.tse_type   = test->tes_type;
-		entp->u.tbe_test.tse_loop   = test->tes_loop;
+		entp->u.tbe_test.tse_type = test->tes_type;
+		entp->u.tbe_test.tse_loop = test->tes_loop;
 		entp->u.tbe_test.tse_concur = test->tes_concur;
 	}
 
@@ -1196,7 +1196,7 @@ lstcon_test_nodes_add(lstcon_test_t *test, struct list_head __user *result_up)
 	LASSERT(test->tes_dst_grp);
 
 	transop = LST_TRANS_TSBSRVADD;
-	grp  = test->tes_dst_grp;
+	grp = test->tes_dst_grp;
 again:
 	rc = lstcon_rpc_trans_ndlist(&grp->grp_ndl_list,
 				     &test->tes_trans_list, transop,
@@ -1317,18 +1317,18 @@ lstcon_test_add(char *batch_name, int type, int loop,
 		goto out;
 	}
 
-	test->tes_hdr.tsb_id	= batch->bat_hdr.tsb_id;
-	test->tes_batch		= batch;
-	test->tes_type		= type;
-	test->tes_oneside	= 0; /* TODO */
-	test->tes_loop		= loop;
-	test->tes_concur	= concur;
-	test->tes_stop_onerr	= 1; /* TODO */
-	test->tes_span		= span;
-	test->tes_dist		= dist;
-	test->tes_cliidx	= 0; /* just used for creating RPC */
-	test->tes_src_grp	= src_grp;
-	test->tes_dst_grp	= dst_grp;
+	test->tes_hdr.tsb_id = batch->bat_hdr.tsb_id;
+	test->tes_batch	= batch;
+	test->tes_type = type;
+	test->tes_oneside = 0; /* TODO */
+	test->tes_loop = loop;
+	test->tes_concur = concur;
+	test->tes_stop_onerr = 1; /* TODO */
+	test->tes_span = span;
+	test->tes_dist = dist;
+	test->tes_cliidx = 0; /* just used for creating RPC */
+	test->tes_src_grp = src_grp;
+	test->tes_dst_grp = dst_grp;
 	INIT_LIST_HEAD(&test->tes_trans_list);
 
 	if (param) {
@@ -1420,8 +1420,8 @@ lstcon_test_batch_query(char *name, int testidx, int client,
 
 	if (!testidx) {
 		translist = &batch->bat_trans_list;
-		ndlist    = &batch->bat_cli_list;
-		hdr       = &batch->bat_hdr;
+		ndlist = &batch->bat_cli_list;
+		hdr = &batch->bat_hdr;
 
 	} else {
 		/* query specified test only */
@@ -1432,8 +1432,8 @@ lstcon_test_batch_query(char *name, int testidx, int client,
 		}
 
 		translist = &test->tes_trans_list;
-		ndlist    = &test->tes_src_grp->grp_ndl_list;
-		hdr       = &test->tes_hdr;
+		ndlist = &test->tes_src_grp->grp_ndl_list;
+		hdr = &test->tes_hdr;
 	}
 
 	transop = client ? LST_TRANS_TSBCLIQRY : LST_TRANS_TSBSRVQRY;
@@ -1689,7 +1689,7 @@ lstcon_nodes_debug(int timeout,
 int
 lstcon_session_match(lst_sid_t sid)
 {
-	return (console_session.ses_id.ses_nid   == sid.ses_nid &&
+	return (console_session.ses_id.ses_nid == sid.ses_nid &&
 		console_session.ses_id.ses_stamp == sid.ses_stamp) ?  1 : 0;
 }
 
@@ -1701,7 +1701,7 @@ lstcon_new_session_id(lst_sid_t *sid)
 	LASSERT(console_session.ses_state == LST_SESSION_NONE);
 
 	LNetGetId(1, &id);
-	sid->ses_nid   = id.nid;
+	sid->ses_nid = id.nid;
 	sid->ses_stamp = cfs_time_current();
 }
 
@@ -1839,9 +1839,9 @@ lstcon_session_end(void)
 	/* waiting for orphan rpcs to die */
 	lstcon_rpc_cleanup_wait();
 
-	console_session.ses_id    = LST_INVALID_SID;
+	console_session.ses_id = LST_INVALID_SID;
 	console_session.ses_state = LST_SESSION_NONE;
-	console_session.ses_key   = 0;
+	console_session.ses_key = 0;
 	console_session.ses_force = 0;
 	console_session.ses_feats_updated = 0;
 
@@ -1866,7 +1866,7 @@ lstcon_session_end(void)
 	LASSERT(list_empty(&console_session.ses_ndl_list));
 
 	console_session.ses_shutdown = 0;
-	console_session.ses_expired  = 0;
+	console_session.ses_expired = 0;
 
 	return rc;
 }
@@ -1965,7 +1965,7 @@ lstcon_acceptor_handle(struct srpc_server_rpc *rpc)
 		goto out;
 	}
 
-	ndl->ndl_node->nd_state   = LST_NODE_ACTIVE;
+	ndl->ndl_node->nd_state = LST_NODE_ACTIVE;
 	ndl->ndl_node->nd_timeout = console_session.ses_timeout;
 
 	if (!grp->grp_userland)
@@ -1974,7 +1974,7 @@ lstcon_acceptor_handle(struct srpc_server_rpc *rpc)
 	strlcpy(jrep->join_session, console_session.ses_name,
 		sizeof(jrep->join_session));
 	jrep->join_timeout = console_session.ses_timeout;
-	jrep->join_status  = 0;
+	jrep->join_status = 0;
 
 out:
 	rep->msg_ses_feats = console_session.ses_features;
@@ -1990,9 +1990,9 @@ static srpc_service_t lstcon_acceptor_service;
 static void lstcon_init_acceptor_service(void)
 {
 	/* initialize selftest console acceptor service table */
-	lstcon_acceptor_service.sv_name     = "join session";
-	lstcon_acceptor_service.sv_handler  = lstcon_acceptor_handle;
-	lstcon_acceptor_service.sv_id       = SRPC_SERVICE_JOIN;
+	lstcon_acceptor_service.sv_name = "join session";
+	lstcon_acceptor_service.sv_handler = lstcon_acceptor_handle;
+	lstcon_acceptor_service.sv_id = SRPC_SERVICE_JOIN;
 	lstcon_acceptor_service.sv_wi_total = SFW_FRWK_WI_MAX;
 }
 
@@ -2009,14 +2009,14 @@ lstcon_console_init(void)
 
 	memset(&console_session, 0, sizeof(struct lstcon_session));
 
-	console_session.ses_id		  = LST_INVALID_SID;
-	console_session.ses_state	  = LST_SESSION_NONE;
-	console_session.ses_timeout	  = 0;
-	console_session.ses_force	  = 0;
-	console_session.ses_expired	  = 0;
+	console_session.ses_id = LST_INVALID_SID;
+	console_session.ses_state = LST_SESSION_NONE;
+	console_session.ses_timeout = 0;
+	console_session.ses_force = 0;
+	console_session.ses_expired = 0;
 	console_session.ses_feats_updated = 0;
-	console_session.ses_features	  = LST_FEATS_MASK;
-	console_session.ses_laststamp	  = ktime_get_real_seconds();
+	console_session.ses_features = LST_FEATS_MASK;
+	console_session.ses_laststamp = ktime_get_real_seconds();
 
 	mutex_init(&console_session.ses_mutex);
 
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index 04bab32..a3ccd78 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -149,7 +149,7 @@ sfw_register_test(srpc_service_t *service, sfw_test_client_ops_t *cliops)
 	if (!tsc)
 		return -ENOMEM;
 
-	tsc->tsc_cli_ops     = cliops;
+	tsc->tsc_cli_ops = cliops;
 	tsc->tsc_srv_service = service;
 
 	list_add_tail(&tsc->tsc_list, &sfw_data.fw_tests);
@@ -271,10 +271,10 @@ sfw_init_session(sfw_session_t *sn, lst_sid_t sid,
 	strlcpy(&sn->sn_name[0], name, sizeof(sn->sn_name));
 
 	sn->sn_timer_active = 0;
-	sn->sn_id           = sid;
-	sn->sn_features	    = features;
-	sn->sn_timeout      = session_timeout;
-	sn->sn_started      = cfs_time_current();
+	sn->sn_id = sid;
+	sn->sn_features = features;
+	sn->sn_timeout = session_timeout;
+	sn->sn_started = cfs_time_current();
 
 	timer->stt_data = sn;
 	timer->stt_func = sfw_session_expired;
@@ -350,9 +350,9 @@ sfw_bid2batch(lst_bid_t bid)
 	if (!bat)
 		return NULL;
 
-	bat->bat_error    = 0;
-	bat->bat_session  = sn;
-	bat->bat_id       = bid;
+	bat->bat_error = 0;
+	bat->bat_session = sn;
+	bat->bat_id = bid;
 	atomic_set(&bat->bat_nactive, 0);
 	INIT_LIST_HEAD(&bat->bat_tests);
 
@@ -386,9 +386,9 @@ sfw_get_stats(srpc_stat_reqst_t *request, srpc_stat_reply_t *reply)
 	 * send over the msecs since the session was started
 	 * with 32 bits to send, this is ~49 days
 	 */
-	cnt->running_ms	     = jiffies_to_msecs(jiffies - sn->sn_started);
-	cnt->brw_errors      = atomic_read(&sn->sn_brw_errors);
-	cnt->ping_errors     = atomic_read(&sn->sn_ping_errors);
+	cnt->running_ms = jiffies_to_msecs(jiffies - sn->sn_started);
+	cnt->brw_errors = atomic_read(&sn->sn_brw_errors);
+	cnt->ping_errors = atomic_read(&sn->sn_ping_errors);
 	cnt->zombie_sessions = atomic_read(&sfw_data.fw_nzombies);
 
 	cnt->active_batches = 0;
@@ -416,8 +416,8 @@ sfw_make_session(srpc_mksn_reqst_t *request, srpc_mksn_reply_t *reply)
 	}
 
 	if (sn) {
-		reply->mksn_status  = 0;
-		reply->mksn_sid     = sn->sn_id;
+		reply->mksn_status = 0;
+		reply->mksn_sid = sn->sn_id;
 		reply->mksn_timeout = sn->sn_timeout;
 
 		if (sfw_sid_equal(request->mksn_sid, sn->sn_id)) {
@@ -466,8 +466,8 @@ sfw_make_session(srpc_mksn_reqst_t *request, srpc_mksn_reply_t *reply)
 
 	spin_unlock(&sfw_data.fw_lock);
 
-	reply->mksn_status  = 0;
-	reply->mksn_sid     = sn->sn_id;
+	reply->mksn_status = 0;
+	reply->mksn_sid = sn->sn_id;
 	reply->mksn_timeout = sn->sn_timeout;
 	return 0;
 }
@@ -499,7 +499,7 @@ sfw_remove_session(srpc_rmsn_reqst_t *request, srpc_rmsn_reply_t *reply)
 	spin_unlock(&sfw_data.fw_lock);
 
 	reply->rmsn_status = 0;
-	reply->rmsn_sid    = LST_INVALID_SID;
+	reply->rmsn_sid = LST_INVALID_SID;
 	LASSERT(!sfw_data.fw_session);
 	return 0;
 }
@@ -511,12 +511,12 @@ sfw_debug_session(srpc_debug_reqst_t *request, srpc_debug_reply_t *reply)
 
 	if (!sn) {
 		reply->dbg_status = ESRCH;
-		reply->dbg_sid    = LST_INVALID_SID;
+		reply->dbg_sid = LST_INVALID_SID;
 		return 0;
 	}
 
-	reply->dbg_status  = 0;
-	reply->dbg_sid     = sn->sn_id;
+	reply->dbg_status = 0;
+	reply->dbg_sid = sn->sn_id;
 	reply->dbg_timeout = sn->sn_timeout;
 	if (strlcpy(reply->dbg_name, &sn->sn_name[0], sizeof(reply->dbg_name))
 	    >= sizeof(reply->dbg_name))
@@ -753,12 +753,12 @@ sfw_add_test_instance(sfw_batch_t *tsb, struct srpc_server_rpc *rpc)
 	INIT_LIST_HEAD(&tsi->tsi_free_rpcs);
 	INIT_LIST_HEAD(&tsi->tsi_active_rpcs);
 
-	tsi->tsi_stopping      = 0;
-	tsi->tsi_batch         = tsb;
-	tsi->tsi_loop          = req->tsr_loop;
-	tsi->tsi_concur        = req->tsr_concur;
-	tsi->tsi_service       = req->tsr_service;
-	tsi->tsi_is_client     = !!(req->tsr_is_client);
+	tsi->tsi_stopping = 0;
+	tsi->tsi_batch = tsb;
+	tsi->tsi_loop = req->tsr_loop;
+	tsi->tsi_concur = req->tsr_concur;
+	tsi->tsi_service = req->tsr_service;
+	tsi->tsi_is_client = !!(req->tsr_is_client);
 	tsi->tsi_stoptsu_onerr = !!(req->tsr_stop_onerr);
 
 	rc = sfw_load_test(tsi);
@@ -806,7 +806,7 @@ sfw_add_test_instance(sfw_batch_t *tsb, struct srpc_server_rpc *rpc)
 			tsu->tsu_dest.nid = id.nid;
 			tsu->tsu_dest.pid = id.pid;
 			tsu->tsu_instance = tsi;
-			tsu->tsu_private  = NULL;
+			tsu->tsu_private = NULL;
 			list_add_tail(&tsu->tsu_list, &tsi->tsi_units);
 		}
 	}
@@ -1269,7 +1269,7 @@ sfw_handle_server_rpc(struct srpc_server_rpc *rpc)
 			CNETERR("Features of framework RPC don't match features of current session: %x/%x\n",
 				request->msg_ses_feats, sn->sn_features);
 			reply->msg_body.reply.status = EPROTO;
-			reply->msg_body.reply.sid    = sn->sn_id;
+			reply->msg_body.reply.sid = sn->sn_id;
 			goto out;
 		}
 
@@ -1652,7 +1652,7 @@ sfw_startup(void)
 
 	memset(&sfw_data, 0, sizeof(struct smoketest_framework));
 
-	sfw_data.fw_session     = NULL;
+	sfw_data.fw_session = NULL;
 	sfw_data.fw_active_srpc = NULL;
 	spin_lock_init(&sfw_data.fw_lock);
 	atomic_set(&sfw_data.fw_nzombies, 0);
@@ -1689,8 +1689,8 @@ sfw_startup(void)
 			break;
 
 		sv->sv_bulk_ready = NULL;
-		sv->sv_handler    = sfw_handle_server_rpc;
-		sv->sv_wi_total   = SFW_FRWK_WI_MAX;
+		sv->sv_handler = sfw_handle_server_rpc;
+		sv->sv_wi_total = SFW_FRWK_WI_MAX;
 		if (sv->sv_id == SRPC_SERVICE_TEST)
 			sv->sv_bulk_ready = sfw_bulk_ready;
 
diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c b/drivers/staging/lustre/lnet/selftest/ping_test.c
index b5e69a7..cb2707a 100644
--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
@@ -111,7 +111,7 @@ ping_client_prep_rpc(sfw_test_unit_t *tsu,
 	spin_unlock(&lst_ping_data.pnd_lock);
 
 	ktime_get_real_ts64(&ts);
-	req->pnr_time_sec  = ts.tv_sec;
+	req->pnr_time_sec = ts.tv_sec;
 	req->pnr_time_usec = ts.tv_nsec / NSEC_PER_USEC;
 
 	return rc;
@@ -194,7 +194,7 @@ ping_server_handle(struct srpc_server_rpc *rpc)
 		return -EINVAL;
 	}
 
-	rep->pnr_seq   = req->pnr_seq;
+	rep->pnr_seq = req->pnr_seq;
 	rep->pnr_magic = LST_PING_TEST_MAGIC;
 
 	if (reqstmsg->msg_ses_feats & ~LST_FEATS_MASK) {
@@ -213,8 +213,8 @@ ping_server_handle(struct srpc_server_rpc *rpc)
 sfw_test_client_ops_t 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_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;
 }
@@ -222,8 +222,8 @@ void ping_init_test_client(void)
 srpc_service_t ping_test_service;
 void ping_init_test_service(void)
 {
-	ping_test_service.sv_id       = SRPC_SERVICE_PING;
-	ping_test_service.sv_name     = "ping_test";
-	ping_test_service.sv_handler  = ping_server_handle;
+	ping_test_service.sv_id = SRPC_SERVICE_PING;
+	ping_test_service.sv_name = "ping_test";
+	ping_test_service.sv_handler = ping_server_handle;
 	ping_test_service.sv_wi_total = ping_srv_workitems;
 }
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index 1af978f..f344d56 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -96,8 +96,8 @@ srpc_add_bulk_page(srpc_bulk_t *bk, struct page *pg, int i, int nob)
 	LASSERT(i >= 0 && i < bk->bk_niov);
 
 	bk->bk_iovs[i].kiov_offset = 0;
-	bk->bk_iovs[i].kiov_page   = pg;
-	bk->bk_iovs[i].kiov_len    = nob;
+	bk->bk_iovs[i].kiov_page = pg;
+	bk->bk_iovs[i].kiov_len = nob;
 	return nob;
 }
 
@@ -136,9 +136,9 @@ srpc_alloc_bulk(int cpt, unsigned bulk_npg, unsigned bulk_len, int sink)
 	}
 
 	memset(bk, 0, offsetof(srpc_bulk_t, bk_iovs[bulk_npg]));
-	bk->bk_sink   = sink;
-	bk->bk_len    = bulk_len;
-	bk->bk_niov   = bulk_npg;
+	bk->bk_sink = sink;
+	bk->bk_len = bulk_len;
+	bk->bk_niov = bulk_npg;
 
 	for (i = 0; i < bulk_npg; i++) {
 		struct page *pg;
@@ -182,10 +182,10 @@ srpc_init_server_rpc(struct srpc_server_rpc *rpc,
 
 	rpc->srpc_ev.ev_fired = 1; /* no event expected now */
 
-	rpc->srpc_scd      = scd;
+	rpc->srpc_scd = scd;
 	rpc->srpc_reqstbuf = buffer;
-	rpc->srpc_peer     = buffer->buf_peer;
-	rpc->srpc_self     = buffer->buf_self;
+	rpc->srpc_peer = buffer->buf_peer;
+	rpc->srpc_self = buffer->buf_self;
 	LNetInvalidateHandle(&rpc->srpc_replymdh);
 }
 
@@ -372,10 +372,10 @@ srpc_post_passive_rdma(int portal, int local, __u64 matchbits, void *buf,
 	}
 
 	md.threshold = 1;
-	md.user_ptr  = ev;
-	md.start     = buf;
-	md.length    = len;
-	md.options   = options;
+	md.user_ptr = ev;
+	md.start = buf;
+	md.length = len;
+	md.options = options;
 	md.eq_handle = srpc_data.rpc_lnet_eq;
 
 	rc = LNetMDAttach(meh, md, LNET_UNLINK, mdh);
@@ -401,12 +401,12 @@ srpc_post_active_rdma(int portal, __u64 matchbits, void *buf, int len,
 	int rc;
 	lnet_md_t md;
 
-	md.user_ptr  = ev;
-	md.start     = buf;
-	md.length    = len;
+	md.user_ptr = ev;
+	md.start = buf;
+	md.length = len;
 	md.eq_handle = srpc_data.rpc_lnet_eq;
 	md.threshold = options & LNET_MD_OP_GET ? 2 : 1;
-	md.options   = options & ~(LNET_MD_OP_PUT | LNET_MD_OP_GET);
+	md.options = options & ~(LNET_MD_OP_PUT | LNET_MD_OP_GET);
 
 	rc = LNetMDBind(md, LNET_UNLINK, mdh);
 	if (rc) {
@@ -798,8 +798,8 @@ srpc_send_request(srpc_client_rpc_t *rpc)
 	int rc;
 
 	ev->ev_fired = 0;
-	ev->ev_data  = rpc;
-	ev->ev_type  = SRPC_REQUEST_SENT;
+	ev->ev_data = rpc;
+	ev->ev_type = SRPC_REQUEST_SENT;
 
 	 rc = srpc_post_active_rdma(srpc_serv_portal(rpc->crpc_service),
 				    rpc->crpc_service, &rpc->crpc_reqstmsg,
@@ -821,8 +821,8 @@ srpc_prepare_reply(srpc_client_rpc_t *rpc)
 	int rc;
 
 	ev->ev_fired = 0;
-	ev->ev_data  = rpc;
-	ev->ev_type  = SRPC_REPLY_RCVD;
+	ev->ev_data = rpc;
+	ev->ev_type = SRPC_REPLY_RCVD;
 
 	*id = srpc_next_id();
 
@@ -855,8 +855,8 @@ srpc_prepare_bulk(srpc_client_rpc_t *rpc)
 	opt |= LNET_MD_KIOV;
 
 	ev->ev_fired = 0;
-	ev->ev_data  = rpc;
-	ev->ev_type  = SRPC_BULK_REQ_RCVD;
+	ev->ev_data = rpc;
+	ev->ev_type = SRPC_BULK_REQ_RCVD;
 
 	*id = srpc_next_id();
 
@@ -885,8 +885,8 @@ srpc_do_bulk(struct srpc_server_rpc *rpc)
 	opt |= LNET_MD_KIOV;
 
 	ev->ev_fired = 0;
-	ev->ev_data  = rpc;
-	ev->ev_type  = bk->bk_sink ? SRPC_BULK_GET_RPLD : SRPC_BULK_PUT_SENT;
+	ev->ev_data = rpc;
+	ev->ev_type = bk->bk_sink ? SRPC_BULK_GET_RPLD : SRPC_BULK_PUT_SENT;
 
 	rc = srpc_post_active_rdma(SRPC_RDMA_PORTAL, id,
 				   &bk->bk_iovs[0], bk->bk_niov, opt,
@@ -1104,8 +1104,8 @@ srpc_add_client_rpc_timer(srpc_client_rpc_t *rpc)
 		return;
 
 	INIT_LIST_HEAD(&timer->stt_list);
-	timer->stt_data    = rpc;
-	timer->stt_func    = srpc_client_rpc_expired;
+	timer->stt_data = rpc;
+	timer->stt_func = srpc_client_rpc_expired;
 	timer->stt_expires = ktime_get_real_seconds() + rpc->crpc_timeout;
 	stt_add_timer(timer);
 }
@@ -1341,7 +1341,7 @@ srpc_abort_rpc(srpc_client_rpc_t *rpc, int why)
 	       swi_state2str(rpc->crpc_wi.swi_state), why);
 
 	rpc->crpc_aborted = 1;
-	rpc->crpc_status  = why;
+	rpc->crpc_status = why;
 	swi_schedule_workitem(&rpc->crpc_wi);
 }
 
@@ -1389,12 +1389,12 @@ srpc_send_reply(struct srpc_server_rpc *rpc)
 	spin_unlock(&scd->scd_lock);
 
 	ev->ev_fired = 0;
-	ev->ev_data  = rpc;
-	ev->ev_type  = SRPC_REPLY_SENT;
+	ev->ev_data = rpc;
+	ev->ev_type = SRPC_REPLY_SENT;
 
-	msg->msg_magic   = SRPC_MSG_MAGIC;
+	msg->msg_magic = SRPC_MSG_MAGIC;
 	msg->msg_version = SRPC_MSG_VERSION;
-	msg->msg_type    = srpc_service2reply(sv->sv_id);
+	msg->msg_type = srpc_service2reply(sv->sv_id);
 
 	rc = srpc_post_active_rdma(SRPC_RDMA_PORTAL, rpyid, msg,
 				   sizeof(*msg), LNET_MD_OP_PUT,
@@ -1464,7 +1464,7 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
 		spin_lock(&crpc->crpc_lock);
 
 		LASSERT(!rpcev->ev_fired);
-		rpcev->ev_fired  = 1;
+		rpcev->ev_fired = 1;
 		rpcev->ev_status = (ev->type == LNET_EVENT_UNLINK) ?
 						-EINTR : ev->status;
 		swi_schedule_workitem(&crpc->crpc_wi);
@@ -1582,13 +1582,13 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
 		}
 	case SRPC_REPLY_SENT:
 		srpc = rpcev->ev_data;
-		scd  = srpc->srpc_scd;
+		scd = srpc->srpc_scd;
 
 		LASSERT(rpcev == &srpc->srpc_ev);
 
 		spin_lock(&scd->scd_lock);
 
-		rpcev->ev_fired  = 1;
+		rpcev->ev_fired = 1;
 		rpcev->ev_status = (ev->type == LNET_EVENT_UNLINK) ?
 				   -EINTR : ev->status;
 		swi_schedule_workitem(&srpc->srpc_wi);
diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h
index b605f7f..7a22bd3 100644
--- a/drivers/staging/lustre/lnet/selftest/selftest.h
+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
@@ -472,9 +472,9 @@ static inline void
 swi_init_workitem(swi_workitem_t *swi, void *data,
 		  swi_action_t action, struct cfs_wi_sched *sched)
 {
-	swi->swi_sched  = sched;
+	swi->swi_sched = sched;
 	swi->swi_action = action;
-	swi->swi_state  = SWI_STATE_NEWBORN;
+	swi->swi_state = SWI_STATE_NEWBORN;
 	cfs_wi_init(&swi->swi_workitem, data, swi_wi_action);
 }
 
@@ -531,13 +531,13 @@ srpc_init_client_rpc(srpc_client_rpc_t *rpc, lnet_process_id_t peer,
 	spin_lock_init(&rpc->crpc_lock);
 	atomic_set(&rpc->crpc_refcount, 1); /* 1 ref for caller */
 
-	rpc->crpc_dest         = peer;
-	rpc->crpc_priv         = priv;
-	rpc->crpc_service      = service;
-	rpc->crpc_bulk.bk_len  = bulklen;
+	rpc->crpc_dest = peer;
+	rpc->crpc_priv = priv;
+	rpc->crpc_service = service;
+	rpc->crpc_bulk.bk_len = bulklen;
 	rpc->crpc_bulk.bk_niov = nbulkiov;
-	rpc->crpc_done         = rpc_done;
-	rpc->crpc_fini         = rpc_fini;
+	rpc->crpc_done = rpc_done;
+	rpc->crpc_fini = rpc_fini;
 	LNetInvalidateHandle(&rpc->crpc_reqstmdh);
 	LNetInvalidateHandle(&rpc->crpc_replymdh);
 	LNetInvalidateHandle(&rpc->crpc_bulk.bk_mdh);
@@ -547,9 +547,9 @@ srpc_init_client_rpc(srpc_client_rpc_t *rpc, lnet_process_id_t peer,
 	rpc->crpc_reqstev.ev_fired = 1;
 	rpc->crpc_replyev.ev_fired = 1;
 
-	rpc->crpc_reqstmsg.msg_magic   = SRPC_MSG_MAGIC;
+	rpc->crpc_reqstmsg.msg_magic = SRPC_MSG_MAGIC;
 	rpc->crpc_reqstmsg.msg_version = SRPC_MSG_VERSION;
-	rpc->crpc_reqstmsg.msg_type    = srpc_service2request(service);
+	rpc->crpc_reqstmsg.msg_type = srpc_service2request(service);
 }
 
 static inline const char *
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 06/10] staging: lustre: filter remaining extra spacing for lnet selftest
  2016-03-12  1:29 ` [lustre-devel] " James Simmons
@ 2016-03-12  1:29   ` James Simmons
  -1 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

This patch is a result of a filter applied to the lnet selftest
code to remove the last bits of hidden white spaces.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/brw_test.c  |    6 +-
 drivers/staging/lustre/lnet/selftest/conctl.c    |   10 +-
 drivers/staging/lustre/lnet/selftest/conrpc.h    |   56 +++---
 drivers/staging/lustre/lnet/selftest/console.c   |    8 +-
 drivers/staging/lustre/lnet/selftest/console.h   |  116 +++++-----
 drivers/staging/lustre/lnet/selftest/framework.c |   86 ++++----
 drivers/staging/lustre/lnet/selftest/module.c    |    2 +-
 drivers/staging/lustre/lnet/selftest/ping_test.c |    2 +-
 drivers/staging/lustre/lnet/selftest/rpc.c       |   10 +-
 drivers/staging/lustre/lnet/selftest/rpc.h       |  178 ++++++++--------
 drivers/staging/lustre/lnet/selftest/selftest.h  |  250 +++++++++++-----------
 drivers/staging/lustre/lnet/selftest/timer.c     |    8 +-
 drivers/staging/lustre/lnet/selftest/timer.h     |    6 +-
 13 files changed, 369 insertions(+), 369 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c
index 0d0c22c..eebc924 100644
--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -131,9 +131,9 @@ brw_client_init(sfw_test_instance_t *tsi)
 	return 0;
 }
 
-#define BRW_POISON      0xbeefbeefbeefbeefULL
-#define BRW_MAGIC       0xeeb0eeb1eeb2eeb3ULL
-#define BRW_MSIZE       sizeof(__u64)
+#define BRW_POISON	0xbeefbeefbeefbeefULL
+#define BRW_MAGIC	0xeeb0eeb1eeb2eeb3ULL
+#define BRW_MSIZE	sizeof(__u64)
 
 static int
 brw_inject_one_error(void)
diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c
index 9793bc6..872df72 100644
--- a/drivers/staging/lustre/lnet/selftest/conctl.c
+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
@@ -100,7 +100,7 @@ lst_session_info_ioctl(lstio_session_info_args_t *args)
 	    !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 <= 0 ||
 	    args->lstio_ses_nmlen > LST_NAME_SIZE)
 		return -EINVAL;
 
@@ -297,7 +297,7 @@ lst_group_update_ioctl(lstio_group_update_args_t *args)
 		break;
 
 	case LST_GROUP_RMND:
-		if (args->lstio_grp_count  <= 0 ||
+		if (args->lstio_grp_count <= 0 ||
 		    !args->lstio_grp_idsp) {
 			rc = -EINVAL;
 			break;
@@ -368,7 +368,7 @@ lst_group_list_ioctl(lstio_group_list_args_t *args)
 	if (args->lstio_grp_key != console_session.ses_key)
 		return -EACCES;
 
-	if (args->lstio_grp_idx   < 0 ||
+	if (args->lstio_grp_idx < 0 ||
 	    !args->lstio_grp_namep ||
 	    args->lstio_grp_nmlen <= 0 ||
 	    args->lstio_grp_nmlen > LST_NAME_SIZE)
@@ -591,7 +591,7 @@ lst_batch_list_ioctl(lstio_batch_list_args_t *args)
 	if (args->lstio_bat_key != console_session.ses_key)
 		return -EACCES;
 
-	if (args->lstio_bat_idx   < 0 ||
+	if (args->lstio_bat_idx < 0 ||
 	    !args->lstio_bat_namep ||
 	    args->lstio_bat_nmlen <= 0 ||
 	    args->lstio_bat_nmlen > LST_NAME_SIZE)
@@ -755,7 +755,7 @@ static int lst_test_add_ioctl(lstio_test_args_t *args)
 		goto out;
 
 	LIBCFS_ALLOC(dst_name, args->lstio_tes_dgrp_nmlen + 1);
-	 if (!dst_name)
+	if (!dst_name)
 		goto out;
 
 	if (args->lstio_tes_param) {
diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.h b/drivers/staging/lustre/lnet/selftest/conrpc.h
index d2133bc..3e7839d 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.h
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.h
@@ -51,12 +51,12 @@
 #include "selftest.h"
 
 /* Console rpc and rpc transaction */
-#define LST_TRANS_TIMEOUT       30
-#define LST_TRANS_MIN_TIMEOUT   3
+#define LST_TRANS_TIMEOUT	30
+#define LST_TRANS_MIN_TIMEOUT	3
 
 #define LST_VALIDATE_TIMEOUT(t) min(max(t, LST_TRANS_MIN_TIMEOUT), LST_TRANS_TIMEOUT)
 
-#define LST_PING_INTERVAL       8
+#define LST_PING_INTERVAL	8
 
 struct lstcon_rpc_trans;
 struct lstcon_tsb_hdr;
@@ -64,46 +64,46 @@ struct lstcon_test;
 struct lstcon_node;
 
 typedef struct lstcon_rpc {
-	struct list_head        crp_link;       /* chain on rpc transaction */
-	srpc_client_rpc_t       *crp_rpc;	/* client rpc */
-	struct lstcon_node      *crp_node;      /* destination node */
-	struct lstcon_rpc_trans *crp_trans;     /* conrpc transaction */
-
-	unsigned int            crp_posted:1;   /* rpc is posted */
-	unsigned int            crp_finished:1; /* rpc is finished */
-	unsigned int            crp_unpacked:1; /* reply is unpacked */
+	struct list_head	 crp_link;	/* chain on rpc transaction */
+	srpc_client_rpc_t	*crp_rpc;	/* client rpc */
+	struct lstcon_node	*crp_node;	/* destination node */
+	struct lstcon_rpc_trans *crp_trans;	/* conrpc transaction */
+
+	unsigned int		 crp_posted:1;	/* rpc is posted */
+	unsigned int		 crp_finished:1; /* rpc is finished */
+	unsigned int		 crp_unpacked:1; /* reply is unpacked */
 	/** RPC is embedded in other structure and can't free it */
-	unsigned int            crp_embedded:1;
-	int                     crp_status;     /* console rpc errors */
-	unsigned long           crp_stamp;      /* replied time stamp */
+	unsigned int		 crp_embedded:1;
+	int			 crp_status;	/* console rpc errors */
+	unsigned long		 crp_stamp;	/* replied time stamp */
 } lstcon_rpc_t;
 
 typedef struct lstcon_rpc_trans {
-	struct list_head  tas_olink;         /* link chain on owner list */
-	struct list_head  tas_link;          /* link chain on global list */
-	int               tas_opc;           /* operation code of transaction */
-	unsigned          tas_feats_updated; /* features mask is uptodate */
-	unsigned          tas_features;      /* test features mask */
-	wait_queue_head_t tas_waitq;         /* wait queue head */
-	atomic_t          tas_remaining;     /* # of un-scheduled rpcs */
+	struct list_head  tas_olink;	     /* link chain on owner list */
+	struct list_head  tas_link;	     /* link chain on global list */
+	int		  tas_opc;	     /* operation code of transaction */
+	unsigned	  tas_feats_updated; /* features mask is uptodate */
+	unsigned	  tas_features;      /* test features mask */
+	wait_queue_head_t tas_waitq;	     /* wait queue head */
+	atomic_t	  tas_remaining;     /* # of un-scheduled rpcs */
 	struct list_head  tas_rpcs_list;     /* queued requests */
 } lstcon_rpc_trans_t;
 
-#define LST_TRANS_PRIVATE       0x1000
+#define LST_TRANS_PRIVATE	0x1000
 
 #define LST_TRANS_SESNEW	(LST_TRANS_PRIVATE | 0x01)
 #define LST_TRANS_SESEND	(LST_TRANS_PRIVATE | 0x02)
 #define LST_TRANS_SESQRY	0x03
-#define LST_TRANS_SESPING       0x04
+#define LST_TRANS_SESPING	0x04
 
-#define LST_TRANS_TSBCLIADD     (LST_TRANS_PRIVATE | 0x11)
-#define LST_TRANS_TSBSRVADD     (LST_TRANS_PRIVATE | 0x12)
+#define LST_TRANS_TSBCLIADD	(LST_TRANS_PRIVATE | 0x11)
+#define LST_TRANS_TSBSRVADD	(LST_TRANS_PRIVATE | 0x12)
 #define LST_TRANS_TSBRUN	(LST_TRANS_PRIVATE | 0x13)
-#define LST_TRANS_TSBSTOP       (LST_TRANS_PRIVATE | 0x14)
-#define LST_TRANS_TSBCLIQRY     0x15
-#define LST_TRANS_TSBSRVQRY     0x16
+#define LST_TRANS_TSBSTOP	(LST_TRANS_PRIVATE | 0x14)
+#define LST_TRANS_TSBCLIQRY	0x15
+#define LST_TRANS_TSBSRVQRY	0x16
 
-#define LST_TRANS_STATQRY       0x21
+#define LST_TRANS_STATQRY	0x21
 
 typedef int (*lstcon_rpc_cond_func_t)(int, struct lstcon_node *, void *);
 typedef int (*lstcon_rpc_readent_func_t)(int, srpc_msg_t *,
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index 15cd830..6017f21 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -49,9 +49,9 @@
 do {							\
 	if ((nd)->nd_state == LST_NODE_ACTIVE)		\
 		(p)->nle_nactive++;			\
-	else if ((nd)->nd_state == LST_NODE_BUSY)       \
+	else if ((nd)->nd_state == LST_NODE_BUSY)	\
 		(p)->nle_nbusy++;			\
-	else if ((nd)->nd_state == LST_NODE_DOWN)       \
+	else if ((nd)->nd_state == LST_NODE_DOWN)	\
 		(p)->nle_ndown++;			\
 	else						\
 		(p)->nle_nunknown++;			\
@@ -1690,7 +1690,7 @@ int
 lstcon_session_match(lst_sid_t sid)
 {
 	return (console_session.ses_id.ses_nid == sid.ses_nid &&
-		console_session.ses_id.ses_stamp == sid.ses_stamp) ?  1 : 0;
+		console_session.ses_id.ses_stamp == sid.ses_stamp) ? 1 : 0;
 }
 
 static void
@@ -1723,7 +1723,7 @@ lstcon_session_new(char *name, int key, unsigned feats,
 		rc = lstcon_session_end();
 
 		/* lstcon_session_end() only return local error */
-		if  (rc)
+		if (rc)
 			return rc;
 	}
 
diff --git a/drivers/staging/lustre/lnet/selftest/console.h b/drivers/staging/lustre/lnet/selftest/console.h
index 5421311..554f582 100644
--- a/drivers/staging/lustre/lnet/selftest/console.h
+++ b/drivers/staging/lustre/lnet/selftest/console.h
@@ -52,79 +52,79 @@
 
 typedef struct lstcon_node {
 	lnet_process_id_t nd_id;      /* id of the node */
-	int               nd_ref;     /* reference count */
-	int               nd_state;   /* state of the node */
-	int               nd_timeout; /* session timeout */
-	unsigned long     nd_stamp;   /* timestamp of last replied RPC */
+	int		  nd_ref;     /* reference count */
+	int		  nd_state;   /* state of the node */
+	int		  nd_timeout; /* session timeout */
+	unsigned long	  nd_stamp;   /* timestamp of last replied RPC */
 	struct lstcon_rpc nd_ping;    /* ping rpc */
 } lstcon_node_t; /* node descriptor */
 
 typedef struct {
 	struct list_head ndl_link;    /* chain on list */
 	struct list_head ndl_hlink;   /* chain on hash */
-	lstcon_node_t    *ndl_node;   /* pointer to node */
+	lstcon_node_t	 *ndl_node;   /* pointer to node */
 } lstcon_ndlink_t; /* node link descriptor */
 
 typedef struct {
-	struct list_head grp_link;                /* chain on global group list
+	struct list_head grp_link;		  /* chain on global group list
 						   */
-	int              grp_ref;                 /* reference count */
-	int              grp_userland;            /* has userland nodes */
-	int              grp_nnode;               /* # of nodes */
-	char             grp_name[LST_NAME_SIZE]; /* group name */
-
-	struct list_head grp_trans_list;          /* transaction list */
-	struct list_head grp_ndl_list;            /* nodes list */
-	struct list_head grp_ndl_hash[0];         /* hash table for nodes */
+	int		 grp_ref;		  /* reference count */
+	int		 grp_userland;		  /* has userland nodes */
+	int		 grp_nnode;		  /* # of nodes */
+	char		 grp_name[LST_NAME_SIZE]; /* group name */
+
+	struct list_head grp_trans_list;	  /* transaction list */
+	struct list_head grp_ndl_list;		  /* nodes list */
+	struct list_head grp_ndl_hash[0];	  /* hash table for nodes */
 } lstcon_group_t; /* (alias of nodes) group descriptor */
 
-#define LST_BATCH_IDLE    0xB0	    /* idle batch */
+#define LST_BATCH_IDLE	  0xB0	    /* idle batch */
 #define LST_BATCH_RUNNING 0xB1	    /* running batch */
 
 typedef struct lstcon_tsb_hdr {
-	lst_bid_t        tsb_id;	 /* batch ID */
-	int              tsb_index;      /* test index */
+	lst_bid_t	 tsb_id;	 /* batch ID */
+	int		 tsb_index;	 /* test index */
 } lstcon_tsb_hdr_t;
 
 typedef struct {
-	lstcon_tsb_hdr_t bat_hdr;         /* test_batch header */
-	struct list_head bat_link;        /* chain on session's batches list */
-	int              bat_ntest;       /* # of test */
-	int              bat_state;       /* state of the batch */
-	int              bat_arg;         /* parameter for run|stop, timeout
+	lstcon_tsb_hdr_t bat_hdr;	  /* test_batch header */
+	struct list_head bat_link;	  /* chain on session's batches list */
+	int		 bat_ntest;	  /* # of test */
+	int		 bat_state;	  /* state of the batch */
+	int		 bat_arg;	  /* parameter for run|stop, timeout
 					   * for run, force for stop */
-	char             bat_name[LST_NAME_SIZE];/* name of batch */
+	char		 bat_name[LST_NAME_SIZE];/* name of batch */
 
 	struct list_head bat_test_list;   /* list head of tests (lstcon_test_t)
 					   */
 	struct list_head bat_trans_list;  /* list head of transaction */
-	struct list_head bat_cli_list;    /* list head of client nodes
+	struct list_head bat_cli_list;	  /* list head of client nodes
 					   * (lstcon_node_t) */
 	struct list_head *bat_cli_hash;   /* hash table of client nodes */
-	struct list_head bat_srv_list;    /* list head of server nodes */
+	struct list_head bat_srv_list;	  /* list head of server nodes */
 	struct list_head *bat_srv_hash;   /* hash table of server nodes */
 } lstcon_batch_t; /* (tests ) batch descriptor */
 
 typedef struct lstcon_test {
-	lstcon_tsb_hdr_t tes_hdr;        /* test batch header */
-	struct list_head tes_link;       /* chain on batch's tests list */
-	lstcon_batch_t   *tes_batch;     /* pointer to batch */
-
-	int              tes_type;       /* type of the test, i.e: bulk, ping */
-	int              tes_stop_onerr; /* stop on error */
-	int              tes_oneside;    /* one-sided test */
-	int              tes_concur;     /* concurrency */
-	int              tes_loop;       /* loop count */
-	int              tes_dist;       /* nodes distribution of target group */
-	int              tes_span;       /* nodes span of target group */
-	int              tes_cliidx;     /* client index, used for RPC creating */
+	lstcon_tsb_hdr_t tes_hdr;	 /* test batch header */
+	struct list_head tes_link;	 /* chain on batch's tests list */
+	lstcon_batch_t	 *tes_batch;	 /* pointer to batch */
+
+	int		 tes_type;	 /* type of the test, i.e: bulk, ping */
+	int		 tes_stop_onerr; /* stop on error */
+	int		 tes_oneside;	 /* one-sided test */
+	int		 tes_concur;	 /* concurrency */
+	int		 tes_loop;	 /* loop count */
+	int		 tes_dist;	 /* nodes distribution of target group */
+	int		 tes_span;	 /* nodes span of target group */
+	int		 tes_cliidx;	 /* client index, used for RPC creating */
 
 	struct list_head tes_trans_list; /* transaction list */
-	lstcon_group_t   *tes_src_grp;   /* group run the test */
-	lstcon_group_t   *tes_dst_grp;   /* target group */
+	lstcon_group_t	 *tes_src_grp;	 /* group run the test */
+	lstcon_group_t	 *tes_dst_grp;	 /* target group */
 
-	int              tes_paramlen;   /* test parameter length */
-	char             tes_param[0];   /* test parameter */
+	int		 tes_paramlen;	 /* test parameter length */
+	char		 tes_param[0];	 /* test parameter */
 } lstcon_test_t; /* a single test descriptor */
 
 #define LST_GLOBAL_HASHSIZE 503	     /* global nodes hash table size */
@@ -136,24 +136,24 @@ typedef struct lstcon_test {
 #define LST_CONSOLE_TIMEOUT 300	     /* default console timeout */
 
 struct lstcon_session {
-	struct mutex        ses_mutex;        /* only 1 thread in session */
-	lst_sid_t           ses_id;           /* global session id */
-	int                 ses_key;          /* local session key */
-	int                 ses_state;        /* state of session */
-	int                 ses_timeout;      /* timeout in seconds */
-	time64_t            ses_laststamp;    /* last operation stamp (seconds)
+	struct mutex	    ses_mutex;	      /* only 1 thread in session */
+	lst_sid_t	    ses_id;	      /* global session id */
+	int		    ses_key;	      /* local session key */
+	int		    ses_state;	      /* state of session */
+	int		    ses_timeout;      /* timeout in seconds */
+	time64_t	    ses_laststamp;    /* last operation stamp (seconds)
 					       */
-	unsigned            ses_features;     /* tests features of the session
+	unsigned	    ses_features;     /* tests features of the session
 					       */
-	unsigned            ses_feats_updated:1; /* features are synced with
+	unsigned	    ses_feats_updated:1; /* features are synced with
 						  * remote test nodes */
-	unsigned            ses_force:1;      /* force creating */
-	unsigned            ses_shutdown:1;   /* session is shutting down */
-	unsigned            ses_expired:1;    /* console is timedout */
-	__u64               ses_id_cookie;    /* batch id cookie */
-	char                ses_name[LST_NAME_SIZE];/* session name */
-	lstcon_rpc_trans_t  *ses_ping;        /* session pinger */
-	struct stt_timer         ses_ping_timer;   /* timer for pinger */
+	unsigned	    ses_force:1;      /* force creating */
+	unsigned	    ses_shutdown:1;   /* session is shutting down */
+	unsigned	    ses_expired:1;    /* console is timedout */
+	__u64		    ses_id_cookie;    /* batch id cookie */
+	char		    ses_name[LST_NAME_SIZE];/* session name */
+	lstcon_rpc_trans_t  *ses_ping;	      /* session pinger */
+	struct stt_timer	 ses_ping_timer;   /* timer for pinger */
 	lstcon_trans_stat_t ses_trans_stat;   /* transaction stats */
 
 	struct list_head    ses_trans_list;   /* global list of transaction */
@@ -162,8 +162,8 @@ struct lstcon_session {
 	struct list_head    ses_ndl_list;     /* global list of nodes */
 	struct list_head    *ses_ndl_hash;    /* hash table of nodes */
 
-	spinlock_t          ses_rpc_lock;     /* serialize */
-	atomic_t            ses_rpc_counter;  /* # of initialized RPCs */
+	spinlock_t	    ses_rpc_lock;     /* serialize */
+	atomic_t	    ses_rpc_counter;  /* # of initialized RPCs */
 	struct list_head    ses_rpc_freelist; /* idle console rpc */
 }; /* session descriptor */
 
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index a3ccd78..2ff47d2 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -53,64 +53,64 @@ static int rpc_timeout = 64;
 module_param(rpc_timeout, int, 0644);
 MODULE_PARM_DESC(rpc_timeout, "rpc timeout in seconds (64 by default, 0 == never)");
 
-#define sfw_unpack_id(id)          \
-do {                               \
-	__swab64s(&(id).nid);	   \
-	__swab32s(&(id).pid);	   \
+#define sfw_unpack_id(id)		\
+do {					\
+	__swab64s(&(id).nid);		\
+	__swab32s(&(id).pid);		\
 } while (0)
 
-#define sfw_unpack_sid(sid)             \
-do {                                    \
-	__swab64s(&(sid).ses_nid);      \
-	__swab64s(&(sid).ses_stamp);    \
+#define sfw_unpack_sid(sid)		\
+do {					\
+	__swab64s(&(sid).ses_nid);	\
+	__swab64s(&(sid).ses_stamp);	\
 } while (0)
 
-#define sfw_unpack_fw_counters(fc)        \
-do {                                      \
-	__swab32s(&(fc).running_ms);      \
+#define sfw_unpack_fw_counters(fc)	  \
+do {					  \
+	__swab32s(&(fc).running_ms);	  \
 	__swab32s(&(fc).active_batches);  \
 	__swab32s(&(fc).zombie_sessions); \
-	__swab32s(&(fc).brw_errors);      \
-	__swab32s(&(fc).ping_errors);     \
+	__swab32s(&(fc).brw_errors);	  \
+	__swab32s(&(fc).ping_errors);	  \
 } while (0)
 
-#define sfw_unpack_rpc_counters(rc)     \
-do {                                    \
+#define sfw_unpack_rpc_counters(rc)	\
+do {					\
 	__swab32s(&(rc).errors);	\
-	__swab32s(&(rc).rpcs_sent);     \
-	__swab32s(&(rc).rpcs_rcvd);     \
-	__swab32s(&(rc).rpcs_dropped);  \
-	__swab32s(&(rc).rpcs_expired);  \
-	__swab64s(&(rc).bulk_get);      \
-	__swab64s(&(rc).bulk_put);      \
+	__swab32s(&(rc).rpcs_sent);	\
+	__swab32s(&(rc).rpcs_rcvd);	\
+	__swab32s(&(rc).rpcs_dropped);	\
+	__swab32s(&(rc).rpcs_expired);	\
+	__swab64s(&(rc).bulk_get);	\
+	__swab64s(&(rc).bulk_put);	\
 } while (0)
 
-#define sfw_unpack_lnet_counters(lc)    \
-do {                                    \
+#define sfw_unpack_lnet_counters(lc)	\
+do {					\
 	__swab32s(&(lc).errors);	\
-	__swab32s(&(lc).msgs_max);      \
-	__swab32s(&(lc).msgs_alloc);    \
-	__swab32s(&(lc).send_count);    \
-	__swab32s(&(lc).recv_count);    \
-	__swab32s(&(lc).drop_count);    \
-	__swab32s(&(lc).route_count);   \
-	__swab64s(&(lc).send_length);   \
-	__swab64s(&(lc).recv_length);   \
-	__swab64s(&(lc).drop_length);   \
-	__swab64s(&(lc).route_length);  \
+	__swab32s(&(lc).msgs_max);	\
+	__swab32s(&(lc).msgs_alloc);	\
+	__swab32s(&(lc).send_count);	\
+	__swab32s(&(lc).recv_count);	\
+	__swab32s(&(lc).drop_count);	\
+	__swab32s(&(lc).route_count);	\
+	__swab64s(&(lc).send_length);	\
+	__swab64s(&(lc).recv_length);	\
+	__swab64s(&(lc).drop_length);	\
+	__swab64s(&(lc).route_length);	\
 } while (0)
 
-#define sfw_test_active(t)      (atomic_read(&(t)->tsi_nactive))
-#define sfw_batch_active(b)     (atomic_read(&(b)->bat_nactive))
+#define sfw_test_active(t)	(atomic_read(&(t)->tsi_nactive))
+#define sfw_batch_active(b)	(atomic_read(&(b)->bat_nactive))
 
 static struct smoketest_framework {
 	struct list_head  fw_zombie_rpcs;     /* RPCs to be recycled */
 	struct list_head  fw_zombie_sessions; /* stopping sessions */
-	struct list_head  fw_tests;           /* registered test cases */
-	atomic_t          fw_nzombies;        /* # zombie sessions */
-	spinlock_t        fw_lock;            /* serialise */
-	sfw_session_t     *fw_session;        /* _the_ session */
-	int               fw_shuttingdown;    /* shutdown in progress */
+	struct list_head  fw_tests;	      /* registered test cases */
+	atomic_t	  fw_nzombies;	      /* # zombie sessions */
+	spinlock_t	  fw_lock;	      /* serialise */
+	sfw_session_t	  *fw_session;	      /* _the_ session */
+	int		  fw_shuttingdown;    /* shutdown in progress */
 	struct srpc_server_rpc *fw_active_srpc;/* running RPC */
 } sfw_data;
 
@@ -194,7 +194,7 @@ sfw_del_session_timer(void)
 
 static void
 sfw_deactivate_session(void)
-	__must_hold(&sfw_data.fw_lock)
+__must_hold(&sfw_data.fw_lock)
 {
 	sfw_session_t *sn = sfw_data.fw_session;
 	int nactive = 0;
@@ -1164,7 +1164,7 @@ sfw_add_test(struct srpc_server_rpc *rpc)
 		if (!(sn->sn_features & LST_FEAT_BULK_LEN)) {
 			len = npg * PAGE_CACHE_SIZE;
 
-		} else  {
+		} else {
 			len = sizeof(lnet_process_id_packed_t) *
 			      request->tsr_ndest;
 		}
@@ -1274,7 +1274,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
diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/lustre/lnet/selftest/module.c
index 55082ce..1e858e9 100644
--- a/drivers/staging/lustre/lnet/selftest/module.c
+++ b/drivers/staging/lustre/lnet/selftest/module.c
@@ -40,7 +40,7 @@
 #include "console.h"
 
 enum {
-	LST_INIT_NONE = 0,
+	LST_INIT_NONE		= 0,
 	LST_INIT_WI_SERIAL,
 	LST_INIT_WI_TEST,
 	LST_INIT_RPC,
diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c b/drivers/staging/lustre/lnet/selftest/ping_test.c
index cb2707a..81a4504 100644
--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
@@ -42,7 +42,7 @@
 
 #include "selftest.h"
 
-#define LST_PING_TEST_MAGIC     0xbabeface
+#define LST_PING_TEST_MAGIC	0xbabeface
 
 static int ping_srv_workitems = SFW_TEST_WI_MAX;
 module_param(ping_srv_workitems, int, 0644);
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index f344d56..69be7d6 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -463,7 +463,7 @@ srpc_post_passive_rqtbuf(int service, int local, void *buf, int len,
 
 static int
 srpc_service_post_buffer(struct srpc_service_cd *scd, struct srpc_buffer *buf)
-	__must_hold(&scd->scd_lock)
+__must_hold(&scd->scd_lock)
 {
 	struct srpc_service *sv = scd->scd_svc;
 	struct srpc_msg	*msg = &buf->buf_msg;
@@ -698,7 +698,7 @@ srpc_finish_service(struct srpc_service *sv)
 /* called with sv->sv_lock held */
 static void
 srpc_service_recycle_buffer(struct srpc_service_cd *scd, srpc_buffer_t *buf)
-	__must_hold(&scd->scd_lock)
+__must_hold(&scd->scd_lock)
 {
 	if (!scd->scd_svc->sv_shuttingdown && scd->scd_buf_adjust >= 0) {
 		if (srpc_service_post_buffer(scd, buf)) {
@@ -1104,8 +1104,8 @@ srpc_add_client_rpc_timer(srpc_client_rpc_t *rpc)
 		return;
 
 	INIT_LIST_HEAD(&timer->stt_list);
-	timer->stt_data = rpc;
-	timer->stt_func = srpc_client_rpc_expired;
+	timer->stt_data	= rpc;
+	timer->stt_func	= srpc_client_rpc_expired;
 	timer->stt_expires = ktime_get_real_seconds() + rpc->crpc_timeout;
 	stt_add_timer(timer);
 }
@@ -1333,7 +1333,7 @@ srpc_abort_rpc(srpc_client_rpc_t *rpc, int why)
 	LASSERT(why);
 
 	if (rpc->crpc_aborted || /* already aborted */
-	    rpc->crpc_closed)    /* callback imminent */
+	    rpc->crpc_closed)	 /* callback imminent */
 		return;
 
 	CDEBUG(D_NET, "Aborting RPC: service %d, peer %s, state %s, why %d\n",
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.h b/drivers/staging/lustre/lnet/selftest/rpc.h
index 9dfb366..a79c315 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.h
+++ b/drivers/staging/lustre/lnet/selftest/rpc.h
@@ -45,24 +45,24 @@
  * XXX: *REPLY == *REQST + 1
  */
 typedef enum {
-	SRPC_MSG_MKSN_REQST     = 0,
-	SRPC_MSG_MKSN_REPLY     = 1,
-	SRPC_MSG_RMSN_REQST     = 2,
-	SRPC_MSG_RMSN_REPLY     = 3,
-	SRPC_MSG_BATCH_REQST    = 4,
-	SRPC_MSG_BATCH_REPLY    = 5,
-	SRPC_MSG_STAT_REQST     = 6,
-	SRPC_MSG_STAT_REPLY     = 7,
-	SRPC_MSG_TEST_REQST     = 8,
-	SRPC_MSG_TEST_REPLY     = 9,
-	SRPC_MSG_DEBUG_REQST    = 10,
-	SRPC_MSG_DEBUG_REPLY    = 11,
-	SRPC_MSG_BRW_REQST      = 12,
-	SRPC_MSG_BRW_REPLY      = 13,
-	SRPC_MSG_PING_REQST     = 14,
-	SRPC_MSG_PING_REPLY     = 15,
-	SRPC_MSG_JOIN_REQST     = 16,
-	SRPC_MSG_JOIN_REPLY     = 17,
+	SRPC_MSG_MKSN_REQST	= 0,
+	SRPC_MSG_MKSN_REPLY	= 1,
+	SRPC_MSG_RMSN_REQST	= 2,
+	SRPC_MSG_RMSN_REPLY	= 3,
+	SRPC_MSG_BATCH_REQST	= 4,
+	SRPC_MSG_BATCH_REPLY	= 5,
+	SRPC_MSG_STAT_REQST	= 6,
+	SRPC_MSG_STAT_REPLY	= 7,
+	SRPC_MSG_TEST_REQST	= 8,
+	SRPC_MSG_TEST_REPLY	= 9,
+	SRPC_MSG_DEBUG_REQST	= 10,
+	SRPC_MSG_DEBUG_REPLY	= 11,
+	SRPC_MSG_BRW_REQST	= 12,
+	SRPC_MSG_BRW_REPLY	= 13,
+	SRPC_MSG_PING_REQST	= 14,
+	SRPC_MSG_PING_REPLY	= 15,
+	SRPC_MSG_JOIN_REQST	= 16,
+	SRPC_MSG_JOIN_REPLY	= 17,
 } srpc_msg_type_t;
 
 /* CAVEAT EMPTOR:
@@ -78,127 +78,127 @@ typedef struct {
 } WIRE_ATTR srpc_generic_reqst_t;
 
 typedef struct {
-	__u32                   status;
-	lst_sid_t               sid;
+	__u32			status;
+	lst_sid_t		sid;
 } WIRE_ATTR srpc_generic_reply_t;
 
 /* FRAMEWORK RPCs */
 typedef struct {
-	__u64                   mksn_rpyid;     /* reply buffer matchbits */
-	lst_sid_t               mksn_sid;	/* session id */
-	__u32			mksn_force;     /* use brute force */
+	__u64			mksn_rpyid;	/* reply buffer matchbits */
+	lst_sid_t		mksn_sid;	/* session id */
+	__u32			mksn_force;	/* use brute force */
 	char			mksn_name[LST_NAME_SIZE];
 } WIRE_ATTR srpc_mksn_reqst_t; /* make session request */
 
 typedef struct {
-	__u32                   mksn_status;    /* session status */
-	lst_sid_t               mksn_sid;       /* session id */
-	__u32                   mksn_timeout;   /* session timeout */
-	char                    mksn_name[LST_NAME_SIZE];
+	__u32			mksn_status;	/* session status */
+	lst_sid_t		mksn_sid;	/* session id */
+	__u32			mksn_timeout;	/* session timeout */
+	char			mksn_name[LST_NAME_SIZE];
 } WIRE_ATTR srpc_mksn_reply_t; /* make session reply */
 
 typedef struct {
-	__u64                   rmsn_rpyid;     /* reply buffer matchbits */
-	lst_sid_t               rmsn_sid;       /* session id */
+	__u64			rmsn_rpyid;	/* reply buffer matchbits */
+	lst_sid_t		rmsn_sid;	/* session id */
 } WIRE_ATTR srpc_rmsn_reqst_t; /* remove session request */
 
 typedef struct {
-	__u32                   rmsn_status;
-	lst_sid_t               rmsn_sid;       /* session id */
+	__u32			rmsn_status;
+	lst_sid_t		rmsn_sid;	/* session id */
 } WIRE_ATTR srpc_rmsn_reply_t; /* remove session reply */
 
 typedef struct {
-	__u64                   join_rpyid;     /* reply buffer matchbits */
-	lst_sid_t               join_sid;       /* session id to join */
-	char                    join_group[LST_NAME_SIZE]; /* group name */
+	__u64			join_rpyid;	/* reply buffer matchbits */
+	lst_sid_t		join_sid;	/* session id to join */
+	char			join_group[LST_NAME_SIZE]; /* group name */
 } WIRE_ATTR srpc_join_reqst_t;
 
 typedef struct {
-	__u32                   join_status;    /* returned status */
-	lst_sid_t               join_sid;       /* session id */
-	__u32			join_timeout;   /* # seconds' inactivity to
+	__u32			join_status;	/* returned status */
+	lst_sid_t		join_sid;	/* session id */
+	__u32			join_timeout;	/* # seconds' inactivity to
 						 * expire */
-	char                    join_session[LST_NAME_SIZE]; /* session name */
+	char			join_session[LST_NAME_SIZE]; /* session name */
 } WIRE_ATTR srpc_join_reply_t;
 
 typedef struct {
-	__u64                   dbg_rpyid;      /* reply buffer matchbits */
-	lst_sid_t               dbg_sid;        /* session id */
-	__u32                   dbg_flags;      /* bitmap of debug */
+	__u64			dbg_rpyid;	/* reply buffer matchbits */
+	lst_sid_t		dbg_sid;	/* session id */
+	__u32			dbg_flags;	/* bitmap of debug */
 } WIRE_ATTR srpc_debug_reqst_t;
 
 typedef struct {
-	__u32                   dbg_status;     /* returned code */
-	lst_sid_t               dbg_sid;        /* session id */
-	__u32                   dbg_timeout;    /* session timeout */
-	__u32                   dbg_nbatch;     /* # of batches in the node */
-	char                    dbg_name[LST_NAME_SIZE]; /* session name */
+	__u32			dbg_status;	/* returned code */
+	lst_sid_t		dbg_sid;	/* session id */
+	__u32			dbg_timeout;	/* session timeout */
+	__u32			dbg_nbatch;	/* # of batches in the node */
+	char			dbg_name[LST_NAME_SIZE]; /* session name */
 } WIRE_ATTR srpc_debug_reply_t;
 
-#define SRPC_BATCH_OPC_RUN      1
-#define SRPC_BATCH_OPC_STOP     2
-#define SRPC_BATCH_OPC_QUERY    3
+#define SRPC_BATCH_OPC_RUN	1
+#define SRPC_BATCH_OPC_STOP	2
+#define SRPC_BATCH_OPC_QUERY	3
 
 typedef struct {
-	__u64              bar_rpyid;      /* reply buffer matchbits */
-	lst_sid_t          bar_sid;        /* session id */
-	lst_bid_t          bar_bid;        /* batch id */
-	__u32              bar_opc;        /* create/start/stop batch */
-	__u32              bar_testidx;    /* index of test */
-	__u32              bar_arg;        /* parameters */
+	__u64		   bar_rpyid;	   /* reply buffer matchbits */
+	lst_sid_t	   bar_sid;	   /* session id */
+	lst_bid_t	   bar_bid;	   /* batch id */
+	__u32		   bar_opc;	   /* create/start/stop batch */
+	__u32		   bar_testidx;    /* index of test */
+	__u32		   bar_arg;	   /* parameters */
 } WIRE_ATTR srpc_batch_reqst_t;
 
 typedef struct {
-	__u32              bar_status;     /* status of request */
-	lst_sid_t          bar_sid;        /* session id */
-	__u32              bar_active;     /* # of active tests in batch/test */
-	__u32              bar_time;       /* remained time */
+	__u32		   bar_status;	   /* status of request */
+	lst_sid_t	   bar_sid;	   /* session id */
+	__u32		   bar_active;	   /* # of active tests in batch/test */
+	__u32		   bar_time;	   /* remained time */
 } WIRE_ATTR srpc_batch_reply_t;
 
 typedef struct {
-	__u64              str_rpyid;      /* reply buffer matchbits */
-	lst_sid_t          str_sid;        /* session id */
-	__u32              str_type;       /* type of stat */
+	__u64		   str_rpyid;	   /* reply buffer matchbits */
+	lst_sid_t	   str_sid;	   /* session id */
+	__u32		   str_type;	   /* type of stat */
 } WIRE_ATTR srpc_stat_reqst_t;
 
 typedef struct {
-	__u32              str_status;
-	lst_sid_t          str_sid;
-	sfw_counters_t     str_fw;
+	__u32		   str_status;
+	lst_sid_t	   str_sid;
+	sfw_counters_t	   str_fw;
 	srpc_counters_t    str_rpc;
 	lnet_counters_t    str_lnet;
 } WIRE_ATTR srpc_stat_reply_t;
 
 typedef struct {
-	__u32              blk_opc;        /* bulk operation code */
-	__u32              blk_npg;        /* # of pages */
-	__u32              blk_flags;      /* reserved flags */
+	__u32		   blk_opc;	   /* bulk operation code */
+	__u32		   blk_npg;	   /* # of pages */
+	__u32		   blk_flags;	   /* reserved flags */
 } WIRE_ATTR test_bulk_req_t;
 
 typedef struct {
-	__u16              blk_opc;        /* bulk operation code */
-	__u16              blk_flags;      /* data check flags */
-	__u32              blk_len;        /* data length */
-	__u32              blk_offset;     /* reserved: offset */
+	__u16		   blk_opc;	   /* bulk operation code */
+	__u16		   blk_flags;	   /* data check flags */
+	__u32		   blk_len;	   /* data length */
+	__u32		   blk_offset;	   /* reserved: offset */
 } WIRE_ATTR test_bulk_req_v1_t;
 
 typedef struct {
-	__u32              png_size;       /* size of ping message */
-	__u32              png_flags;      /* reserved flags */
+	__u32		   png_size;	   /* size of ping message */
+	__u32		   png_flags;	   /* reserved flags */
 } WIRE_ATTR test_ping_req_t;
 
 typedef struct {
-	__u64			tsr_rpyid;      /* reply buffer matchbits */
-	__u64			tsr_bulkid;     /* bulk buffer matchbits */
+	__u64			tsr_rpyid;	/* reply buffer matchbits */
+	__u64			tsr_bulkid;	/* bulk buffer matchbits */
 	lst_sid_t		tsr_sid;	/* session id */
 	lst_bid_t		tsr_bid;	/* batch id */
-	__u32			tsr_service;    /* test type: bulk|ping|... */
-	__u32			tsr_loop;       /* test client loop count or
+	__u32			tsr_service;	/* test type: bulk|ping|... */
+	__u32			tsr_loop;	/* test client loop count or
 						 * # server buffers needed */
-	__u32			tsr_concur;     /* concurrency of test */
-	__u8			tsr_is_client;  /* is test client or not */
+	__u32			tsr_concur;	/* concurrency of test */
+	__u8			tsr_is_client;	/* is test client or not */
 	__u8			tsr_stop_onerr; /* stop on error */
-	__u32			tsr_ndest;      /* # of dest nodes */
+	__u32			tsr_ndest;	/* # of dest nodes */
 
 	union {
 		test_ping_req_t		ping;
@@ -208,7 +208,7 @@ typedef struct {
 } WIRE_ATTR srpc_test_reqst_t;
 
 typedef struct {
-	__u32			tsr_status;     /* returned code */
+	__u32			tsr_status;	/* returned code */
 	lst_sid_t		tsr_sid;
 } WIRE_ATTR srpc_test_reply_t;
 
@@ -228,19 +228,19 @@ typedef struct {
 } WIRE_ATTR srpc_ping_reply_t;
 
 typedef struct {
-	__u64		   brw_rpyid;      /* reply buffer matchbits */
-	__u64		   brw_bulkid;     /* bulk buffer matchbits */
-	__u32		   brw_rw;         /* read or write */
-	__u32		   brw_len;        /* bulk data len */
-	__u32		   brw_flags;      /* bulk data patterns */
+	__u64		   brw_rpyid;	   /* reply buffer matchbits */
+	__u64		   brw_bulkid;	   /* bulk buffer matchbits */
+	__u32		   brw_rw;	   /* read or write */
+	__u32		   brw_len;	   /* bulk data len */
+	__u32		   brw_flags;	   /* bulk data patterns */
 } WIRE_ATTR srpc_brw_reqst_t; /* bulk r/w request */
 
 typedef struct {
 	__u32		   brw_status;
 } WIRE_ATTR srpc_brw_reply_t; /* bulk r/w reply */
 
-#define SRPC_MSG_MAGIC   0xeeb0f00d
-#define SRPC_MSG_VERSION 1
+#define SRPC_MSG_MAGIC		0xeeb0f00d
+#define SRPC_MSG_VERSION	1
 
 typedef struct srpc_msg {
 	__u32	msg_magic;     /* magic number */
diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h
index 7a22bd3..288522d 100644
--- a/drivers/staging/lustre/lnet/selftest/selftest.h
+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
@@ -56,14 +56,14 @@
 #define MADE_WITHOUT_COMPROMISE
 #endif
 
-#define SWI_STATE_NEWBORN           0
-#define SWI_STATE_REPLY_SUBMITTED   1
-#define SWI_STATE_REPLY_SENT        2
-#define SWI_STATE_REQUEST_SUBMITTED 3
-#define SWI_STATE_REQUEST_SENT      4
-#define SWI_STATE_REPLY_RECEIVED    5
-#define SWI_STATE_BULK_STARTED      6
-#define SWI_STATE_DONE             10
+#define SWI_STATE_NEWBORN		0
+#define SWI_STATE_REPLY_SUBMITTED	1
+#define SWI_STATE_REPLY_SENT		2
+#define SWI_STATE_REQUEST_SUBMITTED	3
+#define SWI_STATE_REQUEST_SENT		4
+#define SWI_STATE_REPLY_RECEIVED	5
+#define SWI_STATE_BULK_STARTED		6
+#define SWI_STATE_DONE			10
 
 /* forward refs */
 struct srpc_service;
@@ -74,24 +74,24 @@ struct sfw_test_instance;
 /* services below SRPC_FRAMEWORK_SERVICE_MAX_ID are framework
  * services, e.g. create/modify session.
  */
-#define SRPC_SERVICE_DEBUG             0
-#define SRPC_SERVICE_MAKE_SESSION      1
-#define SRPC_SERVICE_REMOVE_SESSION    2
-#define SRPC_SERVICE_BATCH             3
-#define SRPC_SERVICE_TEST              4
-#define SRPC_SERVICE_QUERY_STAT        5
-#define SRPC_SERVICE_JOIN              6
-#define SRPC_FRAMEWORK_SERVICE_MAX_ID 10
+#define SRPC_SERVICE_DEBUG		0
+#define SRPC_SERVICE_MAKE_SESSION	1
+#define SRPC_SERVICE_REMOVE_SESSION	2
+#define SRPC_SERVICE_BATCH		3
+#define SRPC_SERVICE_TEST		4
+#define SRPC_SERVICE_QUERY_STAT		5
+#define SRPC_SERVICE_JOIN		6
+#define SRPC_FRAMEWORK_SERVICE_MAX_ID	10
 /* other services start from SRPC_FRAMEWORK_SERVICE_MAX_ID+1 */
-#define SRPC_SERVICE_BRW              11
-#define SRPC_SERVICE_PING             12
-#define SRPC_SERVICE_MAX_ID           12
+#define SRPC_SERVICE_BRW		11
+#define SRPC_SERVICE_PING		12
+#define SRPC_SERVICE_MAX_ID		12
 
-#define SRPC_REQUEST_PORTAL           50
+#define SRPC_REQUEST_PORTAL		50
 /* a lazy portal for framework RPC requests */
-#define SRPC_FRAMEWORK_REQUEST_PORTAL 51
+#define SRPC_FRAMEWORK_REQUEST_PORTAL	51
 /* all reply/bulk RDMAs go to this portal */
-#define SRPC_RDMA_PORTAL              52
+#define SRPC_RDMA_PORTAL		52
 
 static inline srpc_msg_type_t
 srpc_service2request(int service)
@@ -149,25 +149,25 @@ typedef enum {
 typedef struct {
 	srpc_event_type_t ev_type;   /* what's up */
 	lnet_event_kind_t ev_lnet;   /* LNet event type */
-	int               ev_fired;  /* LNet event fired? */
-	int               ev_status; /* LNet event status */
-	void              *ev_data;  /* owning server/client RPC */
+	int		  ev_fired;  /* LNet event fired? */
+	int		  ev_status; /* LNet event status */
+	void		  *ev_data;  /* owning server/client RPC */
 } srpc_event_t;
 
 typedef struct {
-	int              bk_len;     /* len of bulk data */
+	int		 bk_len;     /* len of bulk data */
 	lnet_handle_md_t bk_mdh;
-	int              bk_sink;    /* sink/source */
-	int              bk_niov;    /* # iov in bk_iovs */
-	lnet_kiov_t      bk_iovs[0];
+	int		 bk_sink;    /* sink/source */
+	int		 bk_niov;    /* # iov in bk_iovs */
+	lnet_kiov_t	 bk_iovs[0];
 } srpc_bulk_t; /* bulk descriptor */
 
 /* message buffer descriptor */
 typedef struct srpc_buffer {
 	struct list_head  buf_list; /* chain on srpc_service::*_msgq */
-	srpc_msg_t        buf_msg;
+	srpc_msg_t	  buf_msg;
 	lnet_handle_md_t  buf_mdh;
-	lnet_nid_t        buf_self;
+	lnet_nid_t	  buf_self;
 	lnet_process_id_t buf_peer;
 } srpc_buffer_t;
 
@@ -176,9 +176,9 @@ typedef int (*swi_action_t) (struct swi_workitem *);
 
 typedef struct swi_workitem {
 	struct cfs_wi_sched *swi_sched;
-	cfs_workitem_t      swi_workitem;
-	swi_action_t        swi_action;
-	int                 swi_state;
+	cfs_workitem_t	    swi_workitem;
+	swi_action_t	    swi_action;
+	int		    swi_state;
 } swi_workitem_t;
 
 /* server-side state of a RPC */
@@ -186,73 +186,73 @@ struct srpc_server_rpc {
 	/* chain on srpc_service::*_rpcq */
 	struct list_head       srpc_list;
 	struct srpc_service_cd *srpc_scd;
-	swi_workitem_t         srpc_wi;
-	srpc_event_t           srpc_ev;      /* bulk/reply event */
-	lnet_nid_t             srpc_self;
+	swi_workitem_t	       srpc_wi;
+	srpc_event_t	       srpc_ev;      /* bulk/reply event */
+	lnet_nid_t	       srpc_self;
 	lnet_process_id_t      srpc_peer;
-	srpc_msg_t             srpc_replymsg;
+	srpc_msg_t	       srpc_replymsg;
 	lnet_handle_md_t       srpc_replymdh;
-	srpc_buffer_t          *srpc_reqstbuf;
-	srpc_bulk_t            *srpc_bulk;
+	srpc_buffer_t	       *srpc_reqstbuf;
+	srpc_bulk_t	       *srpc_bulk;
 
-	unsigned int           srpc_aborted; /* being given up */
-	int                    srpc_status;
-	void                   (*srpc_done)(struct srpc_server_rpc *);
+	unsigned int	       srpc_aborted; /* being given up */
+	int		       srpc_status;
+	void		       (*srpc_done)(struct srpc_server_rpc *);
 };
 
 /* client-side state of a RPC */
 typedef struct srpc_client_rpc {
-	struct list_head  crpc_list;      /* chain on user's lists */
-	spinlock_t        crpc_lock;      /* serialize */
-	int               crpc_service;
-	atomic_t          crpc_refcount;
-	int               crpc_timeout;   /* # seconds to wait for reply */
+	struct list_head  crpc_list;	  /* chain on user's lists */
+	spinlock_t	  crpc_lock;	  /* serialize */
+	int		  crpc_service;
+	atomic_t	  crpc_refcount;
+	int		  crpc_timeout;   /* # seconds to wait for reply */
 	struct stt_timer       crpc_timer;
-	swi_workitem_t    crpc_wi;
+	swi_workitem_t	  crpc_wi;
 	lnet_process_id_t crpc_dest;
 
-	void              (*crpc_done)(struct srpc_client_rpc *);
-	void              (*crpc_fini)(struct srpc_client_rpc *);
-	int               crpc_status;    /* completion status */
-	void              *crpc_priv;     /* caller data */
+	void		  (*crpc_done)(struct srpc_client_rpc *);
+	void		  (*crpc_fini)(struct srpc_client_rpc *);
+	int		  crpc_status;	  /* completion status */
+	void		  *crpc_priv;	  /* caller data */
 
 	/* state flags */
-	unsigned int      crpc_aborted:1; /* being given up */
-	unsigned int      crpc_closed:1;  /* completed */
+	unsigned int	  crpc_aborted:1; /* being given up */
+	unsigned int	  crpc_closed:1;  /* completed */
 
 	/* RPC events */
-	srpc_event_t      crpc_bulkev;    /* bulk event */
-	srpc_event_t      crpc_reqstev;   /* request event */
-	srpc_event_t      crpc_replyev;   /* reply event */
+	srpc_event_t	  crpc_bulkev;	  /* bulk event */
+	srpc_event_t	  crpc_reqstev;   /* request event */
+	srpc_event_t	  crpc_replyev;   /* reply event */
 
 	/* bulk, request(reqst), and reply exchanged on wire */
-	srpc_msg_t        crpc_reqstmsg;
-	srpc_msg_t        crpc_replymsg;
+	srpc_msg_t	  crpc_reqstmsg;
+	srpc_msg_t	  crpc_replymsg;
 	lnet_handle_md_t  crpc_reqstmdh;
 	lnet_handle_md_t  crpc_replymdh;
-	srpc_bulk_t       crpc_bulk;
+	srpc_bulk_t	  crpc_bulk;
 } srpc_client_rpc_t;
 
-#define srpc_client_rpc_size(rpc)                                        \
+#define srpc_client_rpc_size(rpc)					\
 offsetof(srpc_client_rpc_t, crpc_bulk.bk_iovs[(rpc)->crpc_bulk.bk_niov])
 
-#define srpc_client_rpc_addref(rpc)                                      \
-do {                                                                     \
-	CDEBUG(D_NET, "RPC[%p] -> %s (%d)++\n",                          \
-	       (rpc), libcfs_id2str((rpc)->crpc_dest),                   \
-	       atomic_read(&(rpc)->crpc_refcount));                      \
-	LASSERT(atomic_read(&(rpc)->crpc_refcount) > 0);                 \
-	atomic_inc(&(rpc)->crpc_refcount);                               \
+#define srpc_client_rpc_addref(rpc)					\
+do {									\
+	CDEBUG(D_NET, "RPC[%p] -> %s (%d)++\n",				\
+	       (rpc), libcfs_id2str((rpc)->crpc_dest),			\
+	       atomic_read(&(rpc)->crpc_refcount));			\
+	LASSERT(atomic_read(&(rpc)->crpc_refcount) > 0);		\
+	atomic_inc(&(rpc)->crpc_refcount);				\
 } while (0)
 
-#define srpc_client_rpc_decref(rpc)                                      \
-do {                                                                     \
-	CDEBUG(D_NET, "RPC[%p] -> %s (%d)--\n",                          \
-	       (rpc), libcfs_id2str((rpc)->crpc_dest),                   \
-	       atomic_read(&(rpc)->crpc_refcount));                      \
-	LASSERT(atomic_read(&(rpc)->crpc_refcount) > 0);                 \
-	if (atomic_dec_and_test(&(rpc)->crpc_refcount))                  \
-		srpc_destroy_client_rpc(rpc);                            \
+#define srpc_client_rpc_decref(rpc)					\
+do {									\
+	CDEBUG(D_NET, "RPC[%p] -> %s (%d)--\n",				\
+	       (rpc), libcfs_id2str((rpc)->crpc_dest),			\
+	       atomic_read(&(rpc)->crpc_refcount));			\
+	LASSERT(atomic_read(&(rpc)->crpc_refcount) > 0);		\
+	if (atomic_dec_and_test(&(rpc)->crpc_refcount))			\
+		srpc_destroy_client_rpc(rpc);				\
 } while (0)
 
 #define srpc_event_pending(rpc)   (!(rpc)->crpc_bulkev.ev_fired ||	\
@@ -268,9 +268,9 @@ struct srpc_service_cd {
 	/** event buffer */
 	srpc_event_t		scd_ev;
 	/** free RPC descriptors */
-	struct list_head        scd_rpc_free;
+	struct list_head	scd_rpc_free;
 	/** in-flight RPCs */
-	struct list_head        scd_rpc_active;
+	struct list_head	scd_rpc_active;
 	/** workitem for posting buffer */
 	swi_workitem_t		scd_buf_wi;
 	/** CPT id */
@@ -278,7 +278,7 @@ struct srpc_service_cd {
 	/** error code for scd_buf_wi */
 	int			scd_buf_err;
 	/** timestamp for scd_buf_err */
-	time64_t                scd_buf_err_stamp;
+	time64_t		scd_buf_err_stamp;
 	/** total # request buffers */
 	int			scd_buf_total;
 	/** # posted request buffers */
@@ -290,16 +290,16 @@ struct srpc_service_cd {
 	/** increase/decrease some buffers */
 	int			scd_buf_adjust;
 	/** posted message buffers */
-	struct list_head        scd_buf_posted;
+	struct list_head	scd_buf_posted;
 	/** blocked for RPC descriptor */
-	struct list_head        scd_buf_blocked;
+	struct list_head	scd_buf_blocked;
 };
 
 /* number of server workitems (mini-thread) for testing service */
 #define SFW_TEST_WI_MIN		256
 #define SFW_TEST_WI_MAX		2048
 /* extra buffers for tolerating buggy peers, or unbalanced number
- * of peers between partitions  */
+ * of peers between partitions	*/
 #define SFW_TEST_WI_EXTRA	64
 
 /* number of server workitems (mini-thread) for framework service */
@@ -324,29 +324,29 @@ typedef struct srpc_service {
 
 typedef struct {
 	struct list_head sn_list;    /* chain on fw_zombie_sessions */
-	lst_sid_t        sn_id;      /* unique identifier */
-	unsigned int     sn_timeout; /* # seconds' inactivity to expire */
-	int              sn_timer_active;
-	unsigned int     sn_features;
+	lst_sid_t	 sn_id;      /* unique identifier */
+	unsigned int	 sn_timeout; /* # seconds' inactivity to expire */
+	int		 sn_timer_active;
+	unsigned int	 sn_features;
 	struct stt_timer      sn_timer;
 	struct list_head sn_batches; /* list of batches */
-	char             sn_name[LST_NAME_SIZE];
-	atomic_t         sn_refcount;
-	atomic_t         sn_brw_errors;
-	atomic_t         sn_ping_errors;
-	unsigned long    sn_started;
+	char		 sn_name[LST_NAME_SIZE];
+	atomic_t	 sn_refcount;
+	atomic_t	 sn_brw_errors;
+	atomic_t	 sn_ping_errors;
+	unsigned long	 sn_started;
 } sfw_session_t;
 
 #define sfw_sid_equal(sid0, sid1)     ((sid0).ses_nid == (sid1).ses_nid && \
 				       (sid0).ses_stamp == (sid1).ses_stamp)
 
 typedef struct {
-	struct list_head bat_list;      /* chain on sn_batches */
-	lst_bid_t        bat_id;	/* batch id */
-	int              bat_error;     /* error code of batch */
-	sfw_session_t    *bat_session;  /* batch's session */
-	atomic_t         bat_nactive;   /* # of active tests */
-	struct list_head bat_tests;     /* test instances */
+	struct list_head bat_list;	/* chain on sn_batches */
+	lst_bid_t	 bat_id;	/* batch id */
+	int		 bat_error;	/* error code of batch */
+	sfw_session_t	 *bat_session;	/* batch's session */
+	atomic_t	 bat_nactive;	/* # of active tests */
+	struct list_head bat_tests;	/* test instances */
 } sfw_batch_t;
 
 typedef struct {
@@ -356,32 +356,32 @@ typedef struct {
 							  * client */
 	int  (*tso_prep_rpc)(struct sfw_test_unit *tsu,
 			     lnet_process_id_t dest,
-			     srpc_client_rpc_t **rpc);   /* prep a tests rpc */
+			     srpc_client_rpc_t **rpc);	 /* prep a tests rpc */
 	void (*tso_done_rpc)(struct sfw_test_unit *tsu,
-			     srpc_client_rpc_t *rpc);    /* done a test rpc */
+			     srpc_client_rpc_t *rpc);	 /* done a test rpc */
 } sfw_test_client_ops_t;
 
 typedef struct sfw_test_instance {
-	struct list_head           tsi_list;            /* chain on batch */
-	int                        tsi_service;         /* test type */
-	sfw_batch_t                *tsi_batch;          /* batch */
-	sfw_test_client_ops_t      *tsi_ops;            /* test client operation
+	struct list_head	   tsi_list;		/* chain on batch */
+	int			   tsi_service;		/* test type */
+	sfw_batch_t		   *tsi_batch;		/* batch */
+	sfw_test_client_ops_t	   *tsi_ops;		/* test client operation
 							 */
 
 	/* public parameter for all test units */
-	unsigned int               tsi_is_client:1;     /* is test client */
-	unsigned int               tsi_stoptsu_onerr:1; /* stop tsu on error */
-	int                        tsi_concur;          /* concurrency */
-	int                        tsi_loop;            /* loop count */
+	unsigned int		   tsi_is_client:1;	/* is test client */
+	unsigned int		   tsi_stoptsu_onerr:1; /* stop tsu on error */
+	int			   tsi_concur;		/* concurrency */
+	int			   tsi_loop;		/* loop count */
 
 	/* status of test instance */
-	spinlock_t                 tsi_lock;            /* serialize */
-	unsigned int               tsi_stopping:1;      /* test is stopping */
-	atomic_t                   tsi_nactive;         /* # of active test
+	spinlock_t		   tsi_lock;		/* serialize */
+	unsigned int		   tsi_stopping:1;	/* test is stopping */
+	atomic_t		   tsi_nactive;		/* # of active test
 							 * unit */
-	struct list_head           tsi_units;           /* test units */
-	struct list_head           tsi_free_rpcs;       /* free rpcs */
-	struct list_head           tsi_active_rpcs;     /* active rpcs */
+	struct list_head	   tsi_units;		/* test units */
+	struct list_head	   tsi_free_rpcs;	/* free rpcs */
+	struct list_head	   tsi_active_rpcs;	/* active rpcs */
 
 	union {
 		test_ping_req_t	   ping;    /* ping parameter */
@@ -392,24 +392,24 @@ typedef struct sfw_test_instance {
 
 /* XXX: trailing (PAGE_CACHE_SIZE % sizeof(lnet_process_id_t)) bytes at
  * the end of pages are not used */
-#define SFW_MAX_CONCUR     LST_MAX_CONCUR
+#define SFW_MAX_CONCUR	   LST_MAX_CONCUR
 #define SFW_ID_PER_PAGE    (PAGE_CACHE_SIZE / sizeof(lnet_process_id_packed_t))
-#define SFW_MAX_NDESTS     (LNET_MAX_IOV * SFW_ID_PER_PAGE)
+#define SFW_MAX_NDESTS	   (LNET_MAX_IOV * SFW_ID_PER_PAGE)
 #define sfw_id_pages(n)    (((n) + SFW_ID_PER_PAGE - 1) / SFW_ID_PER_PAGE)
 
 typedef struct sfw_test_unit {
-	struct list_head    tsu_list;      /* chain on lst_test_instance */
-	lnet_process_id_t   tsu_dest;      /* id of dest node */
-	int                 tsu_loop;      /* loop count of the test */
+	struct list_head    tsu_list;	   /* chain on lst_test_instance */
+	lnet_process_id_t   tsu_dest;	   /* id of dest node */
+	int		    tsu_loop;	   /* loop count of the test */
 	sfw_test_instance_t *tsu_instance; /* pointer to test instance */
-	void                *tsu_private;  /* private data */
-	swi_workitem_t      tsu_worker;    /* workitem of the test unit */
+	void		    *tsu_private;  /* private data */
+	swi_workitem_t	    tsu_worker;    /* workitem of the test unit */
 } sfw_test_unit_t;
 
 typedef struct sfw_test_case {
-	struct list_head      tsc_list;         /* chain on fw_tests */
-	srpc_service_t        *tsc_srv_service; /* test service */
-	sfw_test_client_ops_t *tsc_cli_ops;     /* ops of test client */
+	struct list_head      tsc_list;		/* chain on fw_tests */
+	srpc_service_t	      *tsc_srv_service; /* test service */
+	sfw_test_client_ops_t *tsc_cli_ops;	/* ops of test client */
 } sfw_test_case_t;
 
 srpc_client_rpc_t *
@@ -511,7 +511,7 @@ srpc_destroy_client_rpc(srpc_client_rpc_t *rpc)
 	if (!rpc->crpc_fini)
 		LIBCFS_FREE(rpc, srpc_client_rpc_size(rpc));
 	else
-		(*rpc->crpc_fini) (rpc);
+		(*rpc->crpc_fini)(rpc);
 }
 
 static inline void
diff --git a/drivers/staging/lustre/lnet/selftest/timer.c b/drivers/staging/lustre/lnet/selftest/timer.c
index f9f37ba..8be5252 100644
--- a/drivers/staging/lustre/lnet/selftest/timer.c
+++ b/drivers/staging/lustre/lnet/selftest/timer.c
@@ -57,13 +57,13 @@
 						    (STTIMER_NSLOTS - 1))])
 
 static struct st_timer_data {
-	spinlock_t        stt_lock;
-	unsigned long     stt_prev_slot; /* start time of the slot processed
+	spinlock_t	  stt_lock;
+	unsigned long	  stt_prev_slot; /* start time of the slot processed
 					  * previously */
 	struct list_head  stt_hash[STTIMER_NSLOTS];
-	int               stt_shuttingdown;
+	int		  stt_shuttingdown;
 	wait_queue_head_t stt_waitq;
-	int               stt_nthreads;
+	int		  stt_nthreads;
 } stt_data;
 
 void
diff --git a/drivers/staging/lustre/lnet/selftest/timer.h b/drivers/staging/lustre/lnet/selftest/timer.h
index 39327bb..f1fbebd 100644
--- a/drivers/staging/lustre/lnet/selftest/timer.h
+++ b/drivers/staging/lustre/lnet/selftest/timer.h
@@ -40,9 +40,9 @@
 
 struct stt_timer {
 	struct list_head stt_list;
-	time64_t         stt_expires;
-	void             (*stt_func)(void *);
-	void             *stt_data;
+	time64_t	 stt_expires;
+	void		 (*stt_func)(void *);
+	void		 *stt_data;
 };
 
 void stt_add_timer(struct stt_timer *timer);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 06/10] staging: lustre: filter remaining extra spacing for lnet selftest
@ 2016-03-12  1:29   ` James Simmons
  0 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

This patch is a result of a filter applied to the lnet selftest
code to remove the last bits of hidden white spaces.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/brw_test.c  |    6 +-
 drivers/staging/lustre/lnet/selftest/conctl.c    |   10 +-
 drivers/staging/lustre/lnet/selftest/conrpc.h    |   56 +++---
 drivers/staging/lustre/lnet/selftest/console.c   |    8 +-
 drivers/staging/lustre/lnet/selftest/console.h   |  116 +++++-----
 drivers/staging/lustre/lnet/selftest/framework.c |   86 ++++----
 drivers/staging/lustre/lnet/selftest/module.c    |    2 +-
 drivers/staging/lustre/lnet/selftest/ping_test.c |    2 +-
 drivers/staging/lustre/lnet/selftest/rpc.c       |   10 +-
 drivers/staging/lustre/lnet/selftest/rpc.h       |  178 ++++++++--------
 drivers/staging/lustre/lnet/selftest/selftest.h  |  250 +++++++++++-----------
 drivers/staging/lustre/lnet/selftest/timer.c     |    8 +-
 drivers/staging/lustre/lnet/selftest/timer.h     |    6 +-
 13 files changed, 369 insertions(+), 369 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c
index 0d0c22c..eebc924 100644
--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -131,9 +131,9 @@ brw_client_init(sfw_test_instance_t *tsi)
 	return 0;
 }
 
-#define BRW_POISON      0xbeefbeefbeefbeefULL
-#define BRW_MAGIC       0xeeb0eeb1eeb2eeb3ULL
-#define BRW_MSIZE       sizeof(__u64)
+#define BRW_POISON	0xbeefbeefbeefbeefULL
+#define BRW_MAGIC	0xeeb0eeb1eeb2eeb3ULL
+#define BRW_MSIZE	sizeof(__u64)
 
 static int
 brw_inject_one_error(void)
diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c
index 9793bc6..872df72 100644
--- a/drivers/staging/lustre/lnet/selftest/conctl.c
+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
@@ -100,7 +100,7 @@ lst_session_info_ioctl(lstio_session_info_args_t *args)
 	    !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 <= 0 ||
 	    args->lstio_ses_nmlen > LST_NAME_SIZE)
 		return -EINVAL;
 
@@ -297,7 +297,7 @@ lst_group_update_ioctl(lstio_group_update_args_t *args)
 		break;
 
 	case LST_GROUP_RMND:
-		if (args->lstio_grp_count  <= 0 ||
+		if (args->lstio_grp_count <= 0 ||
 		    !args->lstio_grp_idsp) {
 			rc = -EINVAL;
 			break;
@@ -368,7 +368,7 @@ lst_group_list_ioctl(lstio_group_list_args_t *args)
 	if (args->lstio_grp_key != console_session.ses_key)
 		return -EACCES;
 
-	if (args->lstio_grp_idx   < 0 ||
+	if (args->lstio_grp_idx < 0 ||
 	    !args->lstio_grp_namep ||
 	    args->lstio_grp_nmlen <= 0 ||
 	    args->lstio_grp_nmlen > LST_NAME_SIZE)
@@ -591,7 +591,7 @@ lst_batch_list_ioctl(lstio_batch_list_args_t *args)
 	if (args->lstio_bat_key != console_session.ses_key)
 		return -EACCES;
 
-	if (args->lstio_bat_idx   < 0 ||
+	if (args->lstio_bat_idx < 0 ||
 	    !args->lstio_bat_namep ||
 	    args->lstio_bat_nmlen <= 0 ||
 	    args->lstio_bat_nmlen > LST_NAME_SIZE)
@@ -755,7 +755,7 @@ static int lst_test_add_ioctl(lstio_test_args_t *args)
 		goto out;
 
 	LIBCFS_ALLOC(dst_name, args->lstio_tes_dgrp_nmlen + 1);
-	 if (!dst_name)
+	if (!dst_name)
 		goto out;
 
 	if (args->lstio_tes_param) {
diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.h b/drivers/staging/lustre/lnet/selftest/conrpc.h
index d2133bc..3e7839d 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.h
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.h
@@ -51,12 +51,12 @@
 #include "selftest.h"
 
 /* Console rpc and rpc transaction */
-#define LST_TRANS_TIMEOUT       30
-#define LST_TRANS_MIN_TIMEOUT   3
+#define LST_TRANS_TIMEOUT	30
+#define LST_TRANS_MIN_TIMEOUT	3
 
 #define LST_VALIDATE_TIMEOUT(t) min(max(t, LST_TRANS_MIN_TIMEOUT), LST_TRANS_TIMEOUT)
 
-#define LST_PING_INTERVAL       8
+#define LST_PING_INTERVAL	8
 
 struct lstcon_rpc_trans;
 struct lstcon_tsb_hdr;
@@ -64,46 +64,46 @@ struct lstcon_test;
 struct lstcon_node;
 
 typedef struct lstcon_rpc {
-	struct list_head        crp_link;       /* chain on rpc transaction */
-	srpc_client_rpc_t       *crp_rpc;	/* client rpc */
-	struct lstcon_node      *crp_node;      /* destination node */
-	struct lstcon_rpc_trans *crp_trans;     /* conrpc transaction */
-
-	unsigned int            crp_posted:1;   /* rpc is posted */
-	unsigned int            crp_finished:1; /* rpc is finished */
-	unsigned int            crp_unpacked:1; /* reply is unpacked */
+	struct list_head	 crp_link;	/* chain on rpc transaction */
+	srpc_client_rpc_t	*crp_rpc;	/* client rpc */
+	struct lstcon_node	*crp_node;	/* destination node */
+	struct lstcon_rpc_trans *crp_trans;	/* conrpc transaction */
+
+	unsigned int		 crp_posted:1;	/* rpc is posted */
+	unsigned int		 crp_finished:1; /* rpc is finished */
+	unsigned int		 crp_unpacked:1; /* reply is unpacked */
 	/** RPC is embedded in other structure and can't free it */
-	unsigned int            crp_embedded:1;
-	int                     crp_status;     /* console rpc errors */
-	unsigned long           crp_stamp;      /* replied time stamp */
+	unsigned int		 crp_embedded:1;
+	int			 crp_status;	/* console rpc errors */
+	unsigned long		 crp_stamp;	/* replied time stamp */
 } lstcon_rpc_t;
 
 typedef struct lstcon_rpc_trans {
-	struct list_head  tas_olink;         /* link chain on owner list */
-	struct list_head  tas_link;          /* link chain on global list */
-	int               tas_opc;           /* operation code of transaction */
-	unsigned          tas_feats_updated; /* features mask is uptodate */
-	unsigned          tas_features;      /* test features mask */
-	wait_queue_head_t tas_waitq;         /* wait queue head */
-	atomic_t          tas_remaining;     /* # of un-scheduled rpcs */
+	struct list_head  tas_olink;	     /* link chain on owner list */
+	struct list_head  tas_link;	     /* link chain on global list */
+	int		  tas_opc;	     /* operation code of transaction */
+	unsigned	  tas_feats_updated; /* features mask is uptodate */
+	unsigned	  tas_features;      /* test features mask */
+	wait_queue_head_t tas_waitq;	     /* wait queue head */
+	atomic_t	  tas_remaining;     /* # of un-scheduled rpcs */
 	struct list_head  tas_rpcs_list;     /* queued requests */
 } lstcon_rpc_trans_t;
 
-#define LST_TRANS_PRIVATE       0x1000
+#define LST_TRANS_PRIVATE	0x1000
 
 #define LST_TRANS_SESNEW	(LST_TRANS_PRIVATE | 0x01)
 #define LST_TRANS_SESEND	(LST_TRANS_PRIVATE | 0x02)
 #define LST_TRANS_SESQRY	0x03
-#define LST_TRANS_SESPING       0x04
+#define LST_TRANS_SESPING	0x04
 
-#define LST_TRANS_TSBCLIADD     (LST_TRANS_PRIVATE | 0x11)
-#define LST_TRANS_TSBSRVADD     (LST_TRANS_PRIVATE | 0x12)
+#define LST_TRANS_TSBCLIADD	(LST_TRANS_PRIVATE | 0x11)
+#define LST_TRANS_TSBSRVADD	(LST_TRANS_PRIVATE | 0x12)
 #define LST_TRANS_TSBRUN	(LST_TRANS_PRIVATE | 0x13)
-#define LST_TRANS_TSBSTOP       (LST_TRANS_PRIVATE | 0x14)
-#define LST_TRANS_TSBCLIQRY     0x15
-#define LST_TRANS_TSBSRVQRY     0x16
+#define LST_TRANS_TSBSTOP	(LST_TRANS_PRIVATE | 0x14)
+#define LST_TRANS_TSBCLIQRY	0x15
+#define LST_TRANS_TSBSRVQRY	0x16
 
-#define LST_TRANS_STATQRY       0x21
+#define LST_TRANS_STATQRY	0x21
 
 typedef int (*lstcon_rpc_cond_func_t)(int, struct lstcon_node *, void *);
 typedef int (*lstcon_rpc_readent_func_t)(int, srpc_msg_t *,
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index 15cd830..6017f21 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -49,9 +49,9 @@
 do {							\
 	if ((nd)->nd_state == LST_NODE_ACTIVE)		\
 		(p)->nle_nactive++;			\
-	else if ((nd)->nd_state == LST_NODE_BUSY)       \
+	else if ((nd)->nd_state == LST_NODE_BUSY)	\
 		(p)->nle_nbusy++;			\
-	else if ((nd)->nd_state == LST_NODE_DOWN)       \
+	else if ((nd)->nd_state == LST_NODE_DOWN)	\
 		(p)->nle_ndown++;			\
 	else						\
 		(p)->nle_nunknown++;			\
@@ -1690,7 +1690,7 @@ int
 lstcon_session_match(lst_sid_t sid)
 {
 	return (console_session.ses_id.ses_nid == sid.ses_nid &&
-		console_session.ses_id.ses_stamp == sid.ses_stamp) ?  1 : 0;
+		console_session.ses_id.ses_stamp == sid.ses_stamp) ? 1 : 0;
 }
 
 static void
@@ -1723,7 +1723,7 @@ lstcon_session_new(char *name, int key, unsigned feats,
 		rc = lstcon_session_end();
 
 		/* lstcon_session_end() only return local error */
-		if  (rc)
+		if (rc)
 			return rc;
 	}
 
diff --git a/drivers/staging/lustre/lnet/selftest/console.h b/drivers/staging/lustre/lnet/selftest/console.h
index 5421311..554f582 100644
--- a/drivers/staging/lustre/lnet/selftest/console.h
+++ b/drivers/staging/lustre/lnet/selftest/console.h
@@ -52,79 +52,79 @@
 
 typedef struct lstcon_node {
 	lnet_process_id_t nd_id;      /* id of the node */
-	int               nd_ref;     /* reference count */
-	int               nd_state;   /* state of the node */
-	int               nd_timeout; /* session timeout */
-	unsigned long     nd_stamp;   /* timestamp of last replied RPC */
+	int		  nd_ref;     /* reference count */
+	int		  nd_state;   /* state of the node */
+	int		  nd_timeout; /* session timeout */
+	unsigned long	  nd_stamp;   /* timestamp of last replied RPC */
 	struct lstcon_rpc nd_ping;    /* ping rpc */
 } lstcon_node_t; /* node descriptor */
 
 typedef struct {
 	struct list_head ndl_link;    /* chain on list */
 	struct list_head ndl_hlink;   /* chain on hash */
-	lstcon_node_t    *ndl_node;   /* pointer to node */
+	lstcon_node_t	 *ndl_node;   /* pointer to node */
 } lstcon_ndlink_t; /* node link descriptor */
 
 typedef struct {
-	struct list_head grp_link;                /* chain on global group list
+	struct list_head grp_link;		  /* chain on global group list
 						   */
-	int              grp_ref;                 /* reference count */
-	int              grp_userland;            /* has userland nodes */
-	int              grp_nnode;               /* # of nodes */
-	char             grp_name[LST_NAME_SIZE]; /* group name */
-
-	struct list_head grp_trans_list;          /* transaction list */
-	struct list_head grp_ndl_list;            /* nodes list */
-	struct list_head grp_ndl_hash[0];         /* hash table for nodes */
+	int		 grp_ref;		  /* reference count */
+	int		 grp_userland;		  /* has userland nodes */
+	int		 grp_nnode;		  /* # of nodes */
+	char		 grp_name[LST_NAME_SIZE]; /* group name */
+
+	struct list_head grp_trans_list;	  /* transaction list */
+	struct list_head grp_ndl_list;		  /* nodes list */
+	struct list_head grp_ndl_hash[0];	  /* hash table for nodes */
 } lstcon_group_t; /* (alias of nodes) group descriptor */
 
-#define LST_BATCH_IDLE    0xB0	    /* idle batch */
+#define LST_BATCH_IDLE	  0xB0	    /* idle batch */
 #define LST_BATCH_RUNNING 0xB1	    /* running batch */
 
 typedef struct lstcon_tsb_hdr {
-	lst_bid_t        tsb_id;	 /* batch ID */
-	int              tsb_index;      /* test index */
+	lst_bid_t	 tsb_id;	 /* batch ID */
+	int		 tsb_index;	 /* test index */
 } lstcon_tsb_hdr_t;
 
 typedef struct {
-	lstcon_tsb_hdr_t bat_hdr;         /* test_batch header */
-	struct list_head bat_link;        /* chain on session's batches list */
-	int              bat_ntest;       /* # of test */
-	int              bat_state;       /* state of the batch */
-	int              bat_arg;         /* parameter for run|stop, timeout
+	lstcon_tsb_hdr_t bat_hdr;	  /* test_batch header */
+	struct list_head bat_link;	  /* chain on session's batches list */
+	int		 bat_ntest;	  /* # of test */
+	int		 bat_state;	  /* state of the batch */
+	int		 bat_arg;	  /* parameter for run|stop, timeout
 					   * for run, force for stop */
-	char             bat_name[LST_NAME_SIZE];/* name of batch */
+	char		 bat_name[LST_NAME_SIZE];/* name of batch */
 
 	struct list_head bat_test_list;   /* list head of tests (lstcon_test_t)
 					   */
 	struct list_head bat_trans_list;  /* list head of transaction */
-	struct list_head bat_cli_list;    /* list head of client nodes
+	struct list_head bat_cli_list;	  /* list head of client nodes
 					   * (lstcon_node_t) */
 	struct list_head *bat_cli_hash;   /* hash table of client nodes */
-	struct list_head bat_srv_list;    /* list head of server nodes */
+	struct list_head bat_srv_list;	  /* list head of server nodes */
 	struct list_head *bat_srv_hash;   /* hash table of server nodes */
 } lstcon_batch_t; /* (tests ) batch descriptor */
 
 typedef struct lstcon_test {
-	lstcon_tsb_hdr_t tes_hdr;        /* test batch header */
-	struct list_head tes_link;       /* chain on batch's tests list */
-	lstcon_batch_t   *tes_batch;     /* pointer to batch */
-
-	int              tes_type;       /* type of the test, i.e: bulk, ping */
-	int              tes_stop_onerr; /* stop on error */
-	int              tes_oneside;    /* one-sided test */
-	int              tes_concur;     /* concurrency */
-	int              tes_loop;       /* loop count */
-	int              tes_dist;       /* nodes distribution of target group */
-	int              tes_span;       /* nodes span of target group */
-	int              tes_cliidx;     /* client index, used for RPC creating */
+	lstcon_tsb_hdr_t tes_hdr;	 /* test batch header */
+	struct list_head tes_link;	 /* chain on batch's tests list */
+	lstcon_batch_t	 *tes_batch;	 /* pointer to batch */
+
+	int		 tes_type;	 /* type of the test, i.e: bulk, ping */
+	int		 tes_stop_onerr; /* stop on error */
+	int		 tes_oneside;	 /* one-sided test */
+	int		 tes_concur;	 /* concurrency */
+	int		 tes_loop;	 /* loop count */
+	int		 tes_dist;	 /* nodes distribution of target group */
+	int		 tes_span;	 /* nodes span of target group */
+	int		 tes_cliidx;	 /* client index, used for RPC creating */
 
 	struct list_head tes_trans_list; /* transaction list */
-	lstcon_group_t   *tes_src_grp;   /* group run the test */
-	lstcon_group_t   *tes_dst_grp;   /* target group */
+	lstcon_group_t	 *tes_src_grp;	 /* group run the test */
+	lstcon_group_t	 *tes_dst_grp;	 /* target group */
 
-	int              tes_paramlen;   /* test parameter length */
-	char             tes_param[0];   /* test parameter */
+	int		 tes_paramlen;	 /* test parameter length */
+	char		 tes_param[0];	 /* test parameter */
 } lstcon_test_t; /* a single test descriptor */
 
 #define LST_GLOBAL_HASHSIZE 503	     /* global nodes hash table size */
@@ -136,24 +136,24 @@ typedef struct lstcon_test {
 #define LST_CONSOLE_TIMEOUT 300	     /* default console timeout */
 
 struct lstcon_session {
-	struct mutex        ses_mutex;        /* only 1 thread in session */
-	lst_sid_t           ses_id;           /* global session id */
-	int                 ses_key;          /* local session key */
-	int                 ses_state;        /* state of session */
-	int                 ses_timeout;      /* timeout in seconds */
-	time64_t            ses_laststamp;    /* last operation stamp (seconds)
+	struct mutex	    ses_mutex;	      /* only 1 thread in session */
+	lst_sid_t	    ses_id;	      /* global session id */
+	int		    ses_key;	      /* local session key */
+	int		    ses_state;	      /* state of session */
+	int		    ses_timeout;      /* timeout in seconds */
+	time64_t	    ses_laststamp;    /* last operation stamp (seconds)
 					       */
-	unsigned            ses_features;     /* tests features of the session
+	unsigned	    ses_features;     /* tests features of the session
 					       */
-	unsigned            ses_feats_updated:1; /* features are synced with
+	unsigned	    ses_feats_updated:1; /* features are synced with
 						  * remote test nodes */
-	unsigned            ses_force:1;      /* force creating */
-	unsigned            ses_shutdown:1;   /* session is shutting down */
-	unsigned            ses_expired:1;    /* console is timedout */
-	__u64               ses_id_cookie;    /* batch id cookie */
-	char                ses_name[LST_NAME_SIZE];/* session name */
-	lstcon_rpc_trans_t  *ses_ping;        /* session pinger */
-	struct stt_timer         ses_ping_timer;   /* timer for pinger */
+	unsigned	    ses_force:1;      /* force creating */
+	unsigned	    ses_shutdown:1;   /* session is shutting down */
+	unsigned	    ses_expired:1;    /* console is timedout */
+	__u64		    ses_id_cookie;    /* batch id cookie */
+	char		    ses_name[LST_NAME_SIZE];/* session name */
+	lstcon_rpc_trans_t  *ses_ping;	      /* session pinger */
+	struct stt_timer	 ses_ping_timer;   /* timer for pinger */
 	lstcon_trans_stat_t ses_trans_stat;   /* transaction stats */
 
 	struct list_head    ses_trans_list;   /* global list of transaction */
@@ -162,8 +162,8 @@ struct lstcon_session {
 	struct list_head    ses_ndl_list;     /* global list of nodes */
 	struct list_head    *ses_ndl_hash;    /* hash table of nodes */
 
-	spinlock_t          ses_rpc_lock;     /* serialize */
-	atomic_t            ses_rpc_counter;  /* # of initialized RPCs */
+	spinlock_t	    ses_rpc_lock;     /* serialize */
+	atomic_t	    ses_rpc_counter;  /* # of initialized RPCs */
 	struct list_head    ses_rpc_freelist; /* idle console rpc */
 }; /* session descriptor */
 
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index a3ccd78..2ff47d2 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -53,64 +53,64 @@ static int rpc_timeout = 64;
 module_param(rpc_timeout, int, 0644);
 MODULE_PARM_DESC(rpc_timeout, "rpc timeout in seconds (64 by default, 0 == never)");
 
-#define sfw_unpack_id(id)          \
-do {                               \
-	__swab64s(&(id).nid);	   \
-	__swab32s(&(id).pid);	   \
+#define sfw_unpack_id(id)		\
+do {					\
+	__swab64s(&(id).nid);		\
+	__swab32s(&(id).pid);		\
 } while (0)
 
-#define sfw_unpack_sid(sid)             \
-do {                                    \
-	__swab64s(&(sid).ses_nid);      \
-	__swab64s(&(sid).ses_stamp);    \
+#define sfw_unpack_sid(sid)		\
+do {					\
+	__swab64s(&(sid).ses_nid);	\
+	__swab64s(&(sid).ses_stamp);	\
 } while (0)
 
-#define sfw_unpack_fw_counters(fc)        \
-do {                                      \
-	__swab32s(&(fc).running_ms);      \
+#define sfw_unpack_fw_counters(fc)	  \
+do {					  \
+	__swab32s(&(fc).running_ms);	  \
 	__swab32s(&(fc).active_batches);  \
 	__swab32s(&(fc).zombie_sessions); \
-	__swab32s(&(fc).brw_errors);      \
-	__swab32s(&(fc).ping_errors);     \
+	__swab32s(&(fc).brw_errors);	  \
+	__swab32s(&(fc).ping_errors);	  \
 } while (0)
 
-#define sfw_unpack_rpc_counters(rc)     \
-do {                                    \
+#define sfw_unpack_rpc_counters(rc)	\
+do {					\
 	__swab32s(&(rc).errors);	\
-	__swab32s(&(rc).rpcs_sent);     \
-	__swab32s(&(rc).rpcs_rcvd);     \
-	__swab32s(&(rc).rpcs_dropped);  \
-	__swab32s(&(rc).rpcs_expired);  \
-	__swab64s(&(rc).bulk_get);      \
-	__swab64s(&(rc).bulk_put);      \
+	__swab32s(&(rc).rpcs_sent);	\
+	__swab32s(&(rc).rpcs_rcvd);	\
+	__swab32s(&(rc).rpcs_dropped);	\
+	__swab32s(&(rc).rpcs_expired);	\
+	__swab64s(&(rc).bulk_get);	\
+	__swab64s(&(rc).bulk_put);	\
 } while (0)
 
-#define sfw_unpack_lnet_counters(lc)    \
-do {                                    \
+#define sfw_unpack_lnet_counters(lc)	\
+do {					\
 	__swab32s(&(lc).errors);	\
-	__swab32s(&(lc).msgs_max);      \
-	__swab32s(&(lc).msgs_alloc);    \
-	__swab32s(&(lc).send_count);    \
-	__swab32s(&(lc).recv_count);    \
-	__swab32s(&(lc).drop_count);    \
-	__swab32s(&(lc).route_count);   \
-	__swab64s(&(lc).send_length);   \
-	__swab64s(&(lc).recv_length);   \
-	__swab64s(&(lc).drop_length);   \
-	__swab64s(&(lc).route_length);  \
+	__swab32s(&(lc).msgs_max);	\
+	__swab32s(&(lc).msgs_alloc);	\
+	__swab32s(&(lc).send_count);	\
+	__swab32s(&(lc).recv_count);	\
+	__swab32s(&(lc).drop_count);	\
+	__swab32s(&(lc).route_count);	\
+	__swab64s(&(lc).send_length);	\
+	__swab64s(&(lc).recv_length);	\
+	__swab64s(&(lc).drop_length);	\
+	__swab64s(&(lc).route_length);	\
 } while (0)
 
-#define sfw_test_active(t)      (atomic_read(&(t)->tsi_nactive))
-#define sfw_batch_active(b)     (atomic_read(&(b)->bat_nactive))
+#define sfw_test_active(t)	(atomic_read(&(t)->tsi_nactive))
+#define sfw_batch_active(b)	(atomic_read(&(b)->bat_nactive))
 
 static struct smoketest_framework {
 	struct list_head  fw_zombie_rpcs;     /* RPCs to be recycled */
 	struct list_head  fw_zombie_sessions; /* stopping sessions */
-	struct list_head  fw_tests;           /* registered test cases */
-	atomic_t          fw_nzombies;        /* # zombie sessions */
-	spinlock_t        fw_lock;            /* serialise */
-	sfw_session_t     *fw_session;        /* _the_ session */
-	int               fw_shuttingdown;    /* shutdown in progress */
+	struct list_head  fw_tests;	      /* registered test cases */
+	atomic_t	  fw_nzombies;	      /* # zombie sessions */
+	spinlock_t	  fw_lock;	      /* serialise */
+	sfw_session_t	  *fw_session;	      /* _the_ session */
+	int		  fw_shuttingdown;    /* shutdown in progress */
 	struct srpc_server_rpc *fw_active_srpc;/* running RPC */
 } sfw_data;
 
@@ -194,7 +194,7 @@ sfw_del_session_timer(void)
 
 static void
 sfw_deactivate_session(void)
-	__must_hold(&sfw_data.fw_lock)
+__must_hold(&sfw_data.fw_lock)
 {
 	sfw_session_t *sn = sfw_data.fw_session;
 	int nactive = 0;
@@ -1164,7 +1164,7 @@ sfw_add_test(struct srpc_server_rpc *rpc)
 		if (!(sn->sn_features & LST_FEAT_BULK_LEN)) {
 			len = npg * PAGE_CACHE_SIZE;
 
-		} else  {
+		} else {
 			len = sizeof(lnet_process_id_packed_t) *
 			      request->tsr_ndest;
 		}
@@ -1274,7 +1274,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
diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/lustre/lnet/selftest/module.c
index 55082ce..1e858e9 100644
--- a/drivers/staging/lustre/lnet/selftest/module.c
+++ b/drivers/staging/lustre/lnet/selftest/module.c
@@ -40,7 +40,7 @@
 #include "console.h"
 
 enum {
-	LST_INIT_NONE = 0,
+	LST_INIT_NONE		= 0,
 	LST_INIT_WI_SERIAL,
 	LST_INIT_WI_TEST,
 	LST_INIT_RPC,
diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c b/drivers/staging/lustre/lnet/selftest/ping_test.c
index cb2707a..81a4504 100644
--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
@@ -42,7 +42,7 @@
 
 #include "selftest.h"
 
-#define LST_PING_TEST_MAGIC     0xbabeface
+#define LST_PING_TEST_MAGIC	0xbabeface
 
 static int ping_srv_workitems = SFW_TEST_WI_MAX;
 module_param(ping_srv_workitems, int, 0644);
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index f344d56..69be7d6 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -463,7 +463,7 @@ srpc_post_passive_rqtbuf(int service, int local, void *buf, int len,
 
 static int
 srpc_service_post_buffer(struct srpc_service_cd *scd, struct srpc_buffer *buf)
-	__must_hold(&scd->scd_lock)
+__must_hold(&scd->scd_lock)
 {
 	struct srpc_service *sv = scd->scd_svc;
 	struct srpc_msg	*msg = &buf->buf_msg;
@@ -698,7 +698,7 @@ srpc_finish_service(struct srpc_service *sv)
 /* called with sv->sv_lock held */
 static void
 srpc_service_recycle_buffer(struct srpc_service_cd *scd, srpc_buffer_t *buf)
-	__must_hold(&scd->scd_lock)
+__must_hold(&scd->scd_lock)
 {
 	if (!scd->scd_svc->sv_shuttingdown && scd->scd_buf_adjust >= 0) {
 		if (srpc_service_post_buffer(scd, buf)) {
@@ -1104,8 +1104,8 @@ srpc_add_client_rpc_timer(srpc_client_rpc_t *rpc)
 		return;
 
 	INIT_LIST_HEAD(&timer->stt_list);
-	timer->stt_data = rpc;
-	timer->stt_func = srpc_client_rpc_expired;
+	timer->stt_data	= rpc;
+	timer->stt_func	= srpc_client_rpc_expired;
 	timer->stt_expires = ktime_get_real_seconds() + rpc->crpc_timeout;
 	stt_add_timer(timer);
 }
@@ -1333,7 +1333,7 @@ srpc_abort_rpc(srpc_client_rpc_t *rpc, int why)
 	LASSERT(why);
 
 	if (rpc->crpc_aborted || /* already aborted */
-	    rpc->crpc_closed)    /* callback imminent */
+	    rpc->crpc_closed)	 /* callback imminent */
 		return;
 
 	CDEBUG(D_NET, "Aborting RPC: service %d, peer %s, state %s, why %d\n",
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.h b/drivers/staging/lustre/lnet/selftest/rpc.h
index 9dfb366..a79c315 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.h
+++ b/drivers/staging/lustre/lnet/selftest/rpc.h
@@ -45,24 +45,24 @@
  * XXX: *REPLY == *REQST + 1
  */
 typedef enum {
-	SRPC_MSG_MKSN_REQST     = 0,
-	SRPC_MSG_MKSN_REPLY     = 1,
-	SRPC_MSG_RMSN_REQST     = 2,
-	SRPC_MSG_RMSN_REPLY     = 3,
-	SRPC_MSG_BATCH_REQST    = 4,
-	SRPC_MSG_BATCH_REPLY    = 5,
-	SRPC_MSG_STAT_REQST     = 6,
-	SRPC_MSG_STAT_REPLY     = 7,
-	SRPC_MSG_TEST_REQST     = 8,
-	SRPC_MSG_TEST_REPLY     = 9,
-	SRPC_MSG_DEBUG_REQST    = 10,
-	SRPC_MSG_DEBUG_REPLY    = 11,
-	SRPC_MSG_BRW_REQST      = 12,
-	SRPC_MSG_BRW_REPLY      = 13,
-	SRPC_MSG_PING_REQST     = 14,
-	SRPC_MSG_PING_REPLY     = 15,
-	SRPC_MSG_JOIN_REQST     = 16,
-	SRPC_MSG_JOIN_REPLY     = 17,
+	SRPC_MSG_MKSN_REQST	= 0,
+	SRPC_MSG_MKSN_REPLY	= 1,
+	SRPC_MSG_RMSN_REQST	= 2,
+	SRPC_MSG_RMSN_REPLY	= 3,
+	SRPC_MSG_BATCH_REQST	= 4,
+	SRPC_MSG_BATCH_REPLY	= 5,
+	SRPC_MSG_STAT_REQST	= 6,
+	SRPC_MSG_STAT_REPLY	= 7,
+	SRPC_MSG_TEST_REQST	= 8,
+	SRPC_MSG_TEST_REPLY	= 9,
+	SRPC_MSG_DEBUG_REQST	= 10,
+	SRPC_MSG_DEBUG_REPLY	= 11,
+	SRPC_MSG_BRW_REQST	= 12,
+	SRPC_MSG_BRW_REPLY	= 13,
+	SRPC_MSG_PING_REQST	= 14,
+	SRPC_MSG_PING_REPLY	= 15,
+	SRPC_MSG_JOIN_REQST	= 16,
+	SRPC_MSG_JOIN_REPLY	= 17,
 } srpc_msg_type_t;
 
 /* CAVEAT EMPTOR:
@@ -78,127 +78,127 @@ typedef struct {
 } WIRE_ATTR srpc_generic_reqst_t;
 
 typedef struct {
-	__u32                   status;
-	lst_sid_t               sid;
+	__u32			status;
+	lst_sid_t		sid;
 } WIRE_ATTR srpc_generic_reply_t;
 
 /* FRAMEWORK RPCs */
 typedef struct {
-	__u64                   mksn_rpyid;     /* reply buffer matchbits */
-	lst_sid_t               mksn_sid;	/* session id */
-	__u32			mksn_force;     /* use brute force */
+	__u64			mksn_rpyid;	/* reply buffer matchbits */
+	lst_sid_t		mksn_sid;	/* session id */
+	__u32			mksn_force;	/* use brute force */
 	char			mksn_name[LST_NAME_SIZE];
 } WIRE_ATTR srpc_mksn_reqst_t; /* make session request */
 
 typedef struct {
-	__u32                   mksn_status;    /* session status */
-	lst_sid_t               mksn_sid;       /* session id */
-	__u32                   mksn_timeout;   /* session timeout */
-	char                    mksn_name[LST_NAME_SIZE];
+	__u32			mksn_status;	/* session status */
+	lst_sid_t		mksn_sid;	/* session id */
+	__u32			mksn_timeout;	/* session timeout */
+	char			mksn_name[LST_NAME_SIZE];
 } WIRE_ATTR srpc_mksn_reply_t; /* make session reply */
 
 typedef struct {
-	__u64                   rmsn_rpyid;     /* reply buffer matchbits */
-	lst_sid_t               rmsn_sid;       /* session id */
+	__u64			rmsn_rpyid;	/* reply buffer matchbits */
+	lst_sid_t		rmsn_sid;	/* session id */
 } WIRE_ATTR srpc_rmsn_reqst_t; /* remove session request */
 
 typedef struct {
-	__u32                   rmsn_status;
-	lst_sid_t               rmsn_sid;       /* session id */
+	__u32			rmsn_status;
+	lst_sid_t		rmsn_sid;	/* session id */
 } WIRE_ATTR srpc_rmsn_reply_t; /* remove session reply */
 
 typedef struct {
-	__u64                   join_rpyid;     /* reply buffer matchbits */
-	lst_sid_t               join_sid;       /* session id to join */
-	char                    join_group[LST_NAME_SIZE]; /* group name */
+	__u64			join_rpyid;	/* reply buffer matchbits */
+	lst_sid_t		join_sid;	/* session id to join */
+	char			join_group[LST_NAME_SIZE]; /* group name */
 } WIRE_ATTR srpc_join_reqst_t;
 
 typedef struct {
-	__u32                   join_status;    /* returned status */
-	lst_sid_t               join_sid;       /* session id */
-	__u32			join_timeout;   /* # seconds' inactivity to
+	__u32			join_status;	/* returned status */
+	lst_sid_t		join_sid;	/* session id */
+	__u32			join_timeout;	/* # seconds' inactivity to
 						 * expire */
-	char                    join_session[LST_NAME_SIZE]; /* session name */
+	char			join_session[LST_NAME_SIZE]; /* session name */
 } WIRE_ATTR srpc_join_reply_t;
 
 typedef struct {
-	__u64                   dbg_rpyid;      /* reply buffer matchbits */
-	lst_sid_t               dbg_sid;        /* session id */
-	__u32                   dbg_flags;      /* bitmap of debug */
+	__u64			dbg_rpyid;	/* reply buffer matchbits */
+	lst_sid_t		dbg_sid;	/* session id */
+	__u32			dbg_flags;	/* bitmap of debug */
 } WIRE_ATTR srpc_debug_reqst_t;
 
 typedef struct {
-	__u32                   dbg_status;     /* returned code */
-	lst_sid_t               dbg_sid;        /* session id */
-	__u32                   dbg_timeout;    /* session timeout */
-	__u32                   dbg_nbatch;     /* # of batches in the node */
-	char                    dbg_name[LST_NAME_SIZE]; /* session name */
+	__u32			dbg_status;	/* returned code */
+	lst_sid_t		dbg_sid;	/* session id */
+	__u32			dbg_timeout;	/* session timeout */
+	__u32			dbg_nbatch;	/* # of batches in the node */
+	char			dbg_name[LST_NAME_SIZE]; /* session name */
 } WIRE_ATTR srpc_debug_reply_t;
 
-#define SRPC_BATCH_OPC_RUN      1
-#define SRPC_BATCH_OPC_STOP     2
-#define SRPC_BATCH_OPC_QUERY    3
+#define SRPC_BATCH_OPC_RUN	1
+#define SRPC_BATCH_OPC_STOP	2
+#define SRPC_BATCH_OPC_QUERY	3
 
 typedef struct {
-	__u64              bar_rpyid;      /* reply buffer matchbits */
-	lst_sid_t          bar_sid;        /* session id */
-	lst_bid_t          bar_bid;        /* batch id */
-	__u32              bar_opc;        /* create/start/stop batch */
-	__u32              bar_testidx;    /* index of test */
-	__u32              bar_arg;        /* parameters */
+	__u64		   bar_rpyid;	   /* reply buffer matchbits */
+	lst_sid_t	   bar_sid;	   /* session id */
+	lst_bid_t	   bar_bid;	   /* batch id */
+	__u32		   bar_opc;	   /* create/start/stop batch */
+	__u32		   bar_testidx;    /* index of test */
+	__u32		   bar_arg;	   /* parameters */
 } WIRE_ATTR srpc_batch_reqst_t;
 
 typedef struct {
-	__u32              bar_status;     /* status of request */
-	lst_sid_t          bar_sid;        /* session id */
-	__u32              bar_active;     /* # of active tests in batch/test */
-	__u32              bar_time;       /* remained time */
+	__u32		   bar_status;	   /* status of request */
+	lst_sid_t	   bar_sid;	   /* session id */
+	__u32		   bar_active;	   /* # of active tests in batch/test */
+	__u32		   bar_time;	   /* remained time */
 } WIRE_ATTR srpc_batch_reply_t;
 
 typedef struct {
-	__u64              str_rpyid;      /* reply buffer matchbits */
-	lst_sid_t          str_sid;        /* session id */
-	__u32              str_type;       /* type of stat */
+	__u64		   str_rpyid;	   /* reply buffer matchbits */
+	lst_sid_t	   str_sid;	   /* session id */
+	__u32		   str_type;	   /* type of stat */
 } WIRE_ATTR srpc_stat_reqst_t;
 
 typedef struct {
-	__u32              str_status;
-	lst_sid_t          str_sid;
-	sfw_counters_t     str_fw;
+	__u32		   str_status;
+	lst_sid_t	   str_sid;
+	sfw_counters_t	   str_fw;
 	srpc_counters_t    str_rpc;
 	lnet_counters_t    str_lnet;
 } WIRE_ATTR srpc_stat_reply_t;
 
 typedef struct {
-	__u32              blk_opc;        /* bulk operation code */
-	__u32              blk_npg;        /* # of pages */
-	__u32              blk_flags;      /* reserved flags */
+	__u32		   blk_opc;	   /* bulk operation code */
+	__u32		   blk_npg;	   /* # of pages */
+	__u32		   blk_flags;	   /* reserved flags */
 } WIRE_ATTR test_bulk_req_t;
 
 typedef struct {
-	__u16              blk_opc;        /* bulk operation code */
-	__u16              blk_flags;      /* data check flags */
-	__u32              blk_len;        /* data length */
-	__u32              blk_offset;     /* reserved: offset */
+	__u16		   blk_opc;	   /* bulk operation code */
+	__u16		   blk_flags;	   /* data check flags */
+	__u32		   blk_len;	   /* data length */
+	__u32		   blk_offset;	   /* reserved: offset */
 } WIRE_ATTR test_bulk_req_v1_t;
 
 typedef struct {
-	__u32              png_size;       /* size of ping message */
-	__u32              png_flags;      /* reserved flags */
+	__u32		   png_size;	   /* size of ping message */
+	__u32		   png_flags;	   /* reserved flags */
 } WIRE_ATTR test_ping_req_t;
 
 typedef struct {
-	__u64			tsr_rpyid;      /* reply buffer matchbits */
-	__u64			tsr_bulkid;     /* bulk buffer matchbits */
+	__u64			tsr_rpyid;	/* reply buffer matchbits */
+	__u64			tsr_bulkid;	/* bulk buffer matchbits */
 	lst_sid_t		tsr_sid;	/* session id */
 	lst_bid_t		tsr_bid;	/* batch id */
-	__u32			tsr_service;    /* test type: bulk|ping|... */
-	__u32			tsr_loop;       /* test client loop count or
+	__u32			tsr_service;	/* test type: bulk|ping|... */
+	__u32			tsr_loop;	/* test client loop count or
 						 * # server buffers needed */
-	__u32			tsr_concur;     /* concurrency of test */
-	__u8			tsr_is_client;  /* is test client or not */
+	__u32			tsr_concur;	/* concurrency of test */
+	__u8			tsr_is_client;	/* is test client or not */
 	__u8			tsr_stop_onerr; /* stop on error */
-	__u32			tsr_ndest;      /* # of dest nodes */
+	__u32			tsr_ndest;	/* # of dest nodes */
 
 	union {
 		test_ping_req_t		ping;
@@ -208,7 +208,7 @@ typedef struct {
 } WIRE_ATTR srpc_test_reqst_t;
 
 typedef struct {
-	__u32			tsr_status;     /* returned code */
+	__u32			tsr_status;	/* returned code */
 	lst_sid_t		tsr_sid;
 } WIRE_ATTR srpc_test_reply_t;
 
@@ -228,19 +228,19 @@ typedef struct {
 } WIRE_ATTR srpc_ping_reply_t;
 
 typedef struct {
-	__u64		   brw_rpyid;      /* reply buffer matchbits */
-	__u64		   brw_bulkid;     /* bulk buffer matchbits */
-	__u32		   brw_rw;         /* read or write */
-	__u32		   brw_len;        /* bulk data len */
-	__u32		   brw_flags;      /* bulk data patterns */
+	__u64		   brw_rpyid;	   /* reply buffer matchbits */
+	__u64		   brw_bulkid;	   /* bulk buffer matchbits */
+	__u32		   brw_rw;	   /* read or write */
+	__u32		   brw_len;	   /* bulk data len */
+	__u32		   brw_flags;	   /* bulk data patterns */
 } WIRE_ATTR srpc_brw_reqst_t; /* bulk r/w request */
 
 typedef struct {
 	__u32		   brw_status;
 } WIRE_ATTR srpc_brw_reply_t; /* bulk r/w reply */
 
-#define SRPC_MSG_MAGIC   0xeeb0f00d
-#define SRPC_MSG_VERSION 1
+#define SRPC_MSG_MAGIC		0xeeb0f00d
+#define SRPC_MSG_VERSION	1
 
 typedef struct srpc_msg {
 	__u32	msg_magic;     /* magic number */
diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h
index 7a22bd3..288522d 100644
--- a/drivers/staging/lustre/lnet/selftest/selftest.h
+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
@@ -56,14 +56,14 @@
 #define MADE_WITHOUT_COMPROMISE
 #endif
 
-#define SWI_STATE_NEWBORN           0
-#define SWI_STATE_REPLY_SUBMITTED   1
-#define SWI_STATE_REPLY_SENT        2
-#define SWI_STATE_REQUEST_SUBMITTED 3
-#define SWI_STATE_REQUEST_SENT      4
-#define SWI_STATE_REPLY_RECEIVED    5
-#define SWI_STATE_BULK_STARTED      6
-#define SWI_STATE_DONE             10
+#define SWI_STATE_NEWBORN		0
+#define SWI_STATE_REPLY_SUBMITTED	1
+#define SWI_STATE_REPLY_SENT		2
+#define SWI_STATE_REQUEST_SUBMITTED	3
+#define SWI_STATE_REQUEST_SENT		4
+#define SWI_STATE_REPLY_RECEIVED	5
+#define SWI_STATE_BULK_STARTED		6
+#define SWI_STATE_DONE			10
 
 /* forward refs */
 struct srpc_service;
@@ -74,24 +74,24 @@ struct sfw_test_instance;
 /* services below SRPC_FRAMEWORK_SERVICE_MAX_ID are framework
  * services, e.g. create/modify session.
  */
-#define SRPC_SERVICE_DEBUG             0
-#define SRPC_SERVICE_MAKE_SESSION      1
-#define SRPC_SERVICE_REMOVE_SESSION    2
-#define SRPC_SERVICE_BATCH             3
-#define SRPC_SERVICE_TEST              4
-#define SRPC_SERVICE_QUERY_STAT        5
-#define SRPC_SERVICE_JOIN              6
-#define SRPC_FRAMEWORK_SERVICE_MAX_ID 10
+#define SRPC_SERVICE_DEBUG		0
+#define SRPC_SERVICE_MAKE_SESSION	1
+#define SRPC_SERVICE_REMOVE_SESSION	2
+#define SRPC_SERVICE_BATCH		3
+#define SRPC_SERVICE_TEST		4
+#define SRPC_SERVICE_QUERY_STAT		5
+#define SRPC_SERVICE_JOIN		6
+#define SRPC_FRAMEWORK_SERVICE_MAX_ID	10
 /* other services start from SRPC_FRAMEWORK_SERVICE_MAX_ID+1 */
-#define SRPC_SERVICE_BRW              11
-#define SRPC_SERVICE_PING             12
-#define SRPC_SERVICE_MAX_ID           12
+#define SRPC_SERVICE_BRW		11
+#define SRPC_SERVICE_PING		12
+#define SRPC_SERVICE_MAX_ID		12
 
-#define SRPC_REQUEST_PORTAL           50
+#define SRPC_REQUEST_PORTAL		50
 /* a lazy portal for framework RPC requests */
-#define SRPC_FRAMEWORK_REQUEST_PORTAL 51
+#define SRPC_FRAMEWORK_REQUEST_PORTAL	51
 /* all reply/bulk RDMAs go to this portal */
-#define SRPC_RDMA_PORTAL              52
+#define SRPC_RDMA_PORTAL		52
 
 static inline srpc_msg_type_t
 srpc_service2request(int service)
@@ -149,25 +149,25 @@ typedef enum {
 typedef struct {
 	srpc_event_type_t ev_type;   /* what's up */
 	lnet_event_kind_t ev_lnet;   /* LNet event type */
-	int               ev_fired;  /* LNet event fired? */
-	int               ev_status; /* LNet event status */
-	void              *ev_data;  /* owning server/client RPC */
+	int		  ev_fired;  /* LNet event fired? */
+	int		  ev_status; /* LNet event status */
+	void		  *ev_data;  /* owning server/client RPC */
 } srpc_event_t;
 
 typedef struct {
-	int              bk_len;     /* len of bulk data */
+	int		 bk_len;     /* len of bulk data */
 	lnet_handle_md_t bk_mdh;
-	int              bk_sink;    /* sink/source */
-	int              bk_niov;    /* # iov in bk_iovs */
-	lnet_kiov_t      bk_iovs[0];
+	int		 bk_sink;    /* sink/source */
+	int		 bk_niov;    /* # iov in bk_iovs */
+	lnet_kiov_t	 bk_iovs[0];
 } srpc_bulk_t; /* bulk descriptor */
 
 /* message buffer descriptor */
 typedef struct srpc_buffer {
 	struct list_head  buf_list; /* chain on srpc_service::*_msgq */
-	srpc_msg_t        buf_msg;
+	srpc_msg_t	  buf_msg;
 	lnet_handle_md_t  buf_mdh;
-	lnet_nid_t        buf_self;
+	lnet_nid_t	  buf_self;
 	lnet_process_id_t buf_peer;
 } srpc_buffer_t;
 
@@ -176,9 +176,9 @@ typedef int (*swi_action_t) (struct swi_workitem *);
 
 typedef struct swi_workitem {
 	struct cfs_wi_sched *swi_sched;
-	cfs_workitem_t      swi_workitem;
-	swi_action_t        swi_action;
-	int                 swi_state;
+	cfs_workitem_t	    swi_workitem;
+	swi_action_t	    swi_action;
+	int		    swi_state;
 } swi_workitem_t;
 
 /* server-side state of a RPC */
@@ -186,73 +186,73 @@ struct srpc_server_rpc {
 	/* chain on srpc_service::*_rpcq */
 	struct list_head       srpc_list;
 	struct srpc_service_cd *srpc_scd;
-	swi_workitem_t         srpc_wi;
-	srpc_event_t           srpc_ev;      /* bulk/reply event */
-	lnet_nid_t             srpc_self;
+	swi_workitem_t	       srpc_wi;
+	srpc_event_t	       srpc_ev;      /* bulk/reply event */
+	lnet_nid_t	       srpc_self;
 	lnet_process_id_t      srpc_peer;
-	srpc_msg_t             srpc_replymsg;
+	srpc_msg_t	       srpc_replymsg;
 	lnet_handle_md_t       srpc_replymdh;
-	srpc_buffer_t          *srpc_reqstbuf;
-	srpc_bulk_t            *srpc_bulk;
+	srpc_buffer_t	       *srpc_reqstbuf;
+	srpc_bulk_t	       *srpc_bulk;
 
-	unsigned int           srpc_aborted; /* being given up */
-	int                    srpc_status;
-	void                   (*srpc_done)(struct srpc_server_rpc *);
+	unsigned int	       srpc_aborted; /* being given up */
+	int		       srpc_status;
+	void		       (*srpc_done)(struct srpc_server_rpc *);
 };
 
 /* client-side state of a RPC */
 typedef struct srpc_client_rpc {
-	struct list_head  crpc_list;      /* chain on user's lists */
-	spinlock_t        crpc_lock;      /* serialize */
-	int               crpc_service;
-	atomic_t          crpc_refcount;
-	int               crpc_timeout;   /* # seconds to wait for reply */
+	struct list_head  crpc_list;	  /* chain on user's lists */
+	spinlock_t	  crpc_lock;	  /* serialize */
+	int		  crpc_service;
+	atomic_t	  crpc_refcount;
+	int		  crpc_timeout;   /* # seconds to wait for reply */
 	struct stt_timer       crpc_timer;
-	swi_workitem_t    crpc_wi;
+	swi_workitem_t	  crpc_wi;
 	lnet_process_id_t crpc_dest;
 
-	void              (*crpc_done)(struct srpc_client_rpc *);
-	void              (*crpc_fini)(struct srpc_client_rpc *);
-	int               crpc_status;    /* completion status */
-	void              *crpc_priv;     /* caller data */
+	void		  (*crpc_done)(struct srpc_client_rpc *);
+	void		  (*crpc_fini)(struct srpc_client_rpc *);
+	int		  crpc_status;	  /* completion status */
+	void		  *crpc_priv;	  /* caller data */
 
 	/* state flags */
-	unsigned int      crpc_aborted:1; /* being given up */
-	unsigned int      crpc_closed:1;  /* completed */
+	unsigned int	  crpc_aborted:1; /* being given up */
+	unsigned int	  crpc_closed:1;  /* completed */
 
 	/* RPC events */
-	srpc_event_t      crpc_bulkev;    /* bulk event */
-	srpc_event_t      crpc_reqstev;   /* request event */
-	srpc_event_t      crpc_replyev;   /* reply event */
+	srpc_event_t	  crpc_bulkev;	  /* bulk event */
+	srpc_event_t	  crpc_reqstev;   /* request event */
+	srpc_event_t	  crpc_replyev;   /* reply event */
 
 	/* bulk, request(reqst), and reply exchanged on wire */
-	srpc_msg_t        crpc_reqstmsg;
-	srpc_msg_t        crpc_replymsg;
+	srpc_msg_t	  crpc_reqstmsg;
+	srpc_msg_t	  crpc_replymsg;
 	lnet_handle_md_t  crpc_reqstmdh;
 	lnet_handle_md_t  crpc_replymdh;
-	srpc_bulk_t       crpc_bulk;
+	srpc_bulk_t	  crpc_bulk;
 } srpc_client_rpc_t;
 
-#define srpc_client_rpc_size(rpc)                                        \
+#define srpc_client_rpc_size(rpc)					\
 offsetof(srpc_client_rpc_t, crpc_bulk.bk_iovs[(rpc)->crpc_bulk.bk_niov])
 
-#define srpc_client_rpc_addref(rpc)                                      \
-do {                                                                     \
-	CDEBUG(D_NET, "RPC[%p] -> %s (%d)++\n",                          \
-	       (rpc), libcfs_id2str((rpc)->crpc_dest),                   \
-	       atomic_read(&(rpc)->crpc_refcount));                      \
-	LASSERT(atomic_read(&(rpc)->crpc_refcount) > 0);                 \
-	atomic_inc(&(rpc)->crpc_refcount);                               \
+#define srpc_client_rpc_addref(rpc)					\
+do {									\
+	CDEBUG(D_NET, "RPC[%p] -> %s (%d)++\n",				\
+	       (rpc), libcfs_id2str((rpc)->crpc_dest),			\
+	       atomic_read(&(rpc)->crpc_refcount));			\
+	LASSERT(atomic_read(&(rpc)->crpc_refcount) > 0);		\
+	atomic_inc(&(rpc)->crpc_refcount);				\
 } while (0)
 
-#define srpc_client_rpc_decref(rpc)                                      \
-do {                                                                     \
-	CDEBUG(D_NET, "RPC[%p] -> %s (%d)--\n",                          \
-	       (rpc), libcfs_id2str((rpc)->crpc_dest),                   \
-	       atomic_read(&(rpc)->crpc_refcount));                      \
-	LASSERT(atomic_read(&(rpc)->crpc_refcount) > 0);                 \
-	if (atomic_dec_and_test(&(rpc)->crpc_refcount))                  \
-		srpc_destroy_client_rpc(rpc);                            \
+#define srpc_client_rpc_decref(rpc)					\
+do {									\
+	CDEBUG(D_NET, "RPC[%p] -> %s (%d)--\n",				\
+	       (rpc), libcfs_id2str((rpc)->crpc_dest),			\
+	       atomic_read(&(rpc)->crpc_refcount));			\
+	LASSERT(atomic_read(&(rpc)->crpc_refcount) > 0);		\
+	if (atomic_dec_and_test(&(rpc)->crpc_refcount))			\
+		srpc_destroy_client_rpc(rpc);				\
 } while (0)
 
 #define srpc_event_pending(rpc)   (!(rpc)->crpc_bulkev.ev_fired ||	\
@@ -268,9 +268,9 @@ struct srpc_service_cd {
 	/** event buffer */
 	srpc_event_t		scd_ev;
 	/** free RPC descriptors */
-	struct list_head        scd_rpc_free;
+	struct list_head	scd_rpc_free;
 	/** in-flight RPCs */
-	struct list_head        scd_rpc_active;
+	struct list_head	scd_rpc_active;
 	/** workitem for posting buffer */
 	swi_workitem_t		scd_buf_wi;
 	/** CPT id */
@@ -278,7 +278,7 @@ struct srpc_service_cd {
 	/** error code for scd_buf_wi */
 	int			scd_buf_err;
 	/** timestamp for scd_buf_err */
-	time64_t                scd_buf_err_stamp;
+	time64_t		scd_buf_err_stamp;
 	/** total # request buffers */
 	int			scd_buf_total;
 	/** # posted request buffers */
@@ -290,16 +290,16 @@ struct srpc_service_cd {
 	/** increase/decrease some buffers */
 	int			scd_buf_adjust;
 	/** posted message buffers */
-	struct list_head        scd_buf_posted;
+	struct list_head	scd_buf_posted;
 	/** blocked for RPC descriptor */
-	struct list_head        scd_buf_blocked;
+	struct list_head	scd_buf_blocked;
 };
 
 /* number of server workitems (mini-thread) for testing service */
 #define SFW_TEST_WI_MIN		256
 #define SFW_TEST_WI_MAX		2048
 /* extra buffers for tolerating buggy peers, or unbalanced number
- * of peers between partitions  */
+ * of peers between partitions	*/
 #define SFW_TEST_WI_EXTRA	64
 
 /* number of server workitems (mini-thread) for framework service */
@@ -324,29 +324,29 @@ typedef struct srpc_service {
 
 typedef struct {
 	struct list_head sn_list;    /* chain on fw_zombie_sessions */
-	lst_sid_t        sn_id;      /* unique identifier */
-	unsigned int     sn_timeout; /* # seconds' inactivity to expire */
-	int              sn_timer_active;
-	unsigned int     sn_features;
+	lst_sid_t	 sn_id;      /* unique identifier */
+	unsigned int	 sn_timeout; /* # seconds' inactivity to expire */
+	int		 sn_timer_active;
+	unsigned int	 sn_features;
 	struct stt_timer      sn_timer;
 	struct list_head sn_batches; /* list of batches */
-	char             sn_name[LST_NAME_SIZE];
-	atomic_t         sn_refcount;
-	atomic_t         sn_brw_errors;
-	atomic_t         sn_ping_errors;
-	unsigned long    sn_started;
+	char		 sn_name[LST_NAME_SIZE];
+	atomic_t	 sn_refcount;
+	atomic_t	 sn_brw_errors;
+	atomic_t	 sn_ping_errors;
+	unsigned long	 sn_started;
 } sfw_session_t;
 
 #define sfw_sid_equal(sid0, sid1)     ((sid0).ses_nid == (sid1).ses_nid && \
 				       (sid0).ses_stamp == (sid1).ses_stamp)
 
 typedef struct {
-	struct list_head bat_list;      /* chain on sn_batches */
-	lst_bid_t        bat_id;	/* batch id */
-	int              bat_error;     /* error code of batch */
-	sfw_session_t    *bat_session;  /* batch's session */
-	atomic_t         bat_nactive;   /* # of active tests */
-	struct list_head bat_tests;     /* test instances */
+	struct list_head bat_list;	/* chain on sn_batches */
+	lst_bid_t	 bat_id;	/* batch id */
+	int		 bat_error;	/* error code of batch */
+	sfw_session_t	 *bat_session;	/* batch's session */
+	atomic_t	 bat_nactive;	/* # of active tests */
+	struct list_head bat_tests;	/* test instances */
 } sfw_batch_t;
 
 typedef struct {
@@ -356,32 +356,32 @@ typedef struct {
 							  * client */
 	int  (*tso_prep_rpc)(struct sfw_test_unit *tsu,
 			     lnet_process_id_t dest,
-			     srpc_client_rpc_t **rpc);   /* prep a tests rpc */
+			     srpc_client_rpc_t **rpc);	 /* prep a tests rpc */
 	void (*tso_done_rpc)(struct sfw_test_unit *tsu,
-			     srpc_client_rpc_t *rpc);    /* done a test rpc */
+			     srpc_client_rpc_t *rpc);	 /* done a test rpc */
 } sfw_test_client_ops_t;
 
 typedef struct sfw_test_instance {
-	struct list_head           tsi_list;            /* chain on batch */
-	int                        tsi_service;         /* test type */
-	sfw_batch_t                *tsi_batch;          /* batch */
-	sfw_test_client_ops_t      *tsi_ops;            /* test client operation
+	struct list_head	   tsi_list;		/* chain on batch */
+	int			   tsi_service;		/* test type */
+	sfw_batch_t		   *tsi_batch;		/* batch */
+	sfw_test_client_ops_t	   *tsi_ops;		/* test client operation
 							 */
 
 	/* public parameter for all test units */
-	unsigned int               tsi_is_client:1;     /* is test client */
-	unsigned int               tsi_stoptsu_onerr:1; /* stop tsu on error */
-	int                        tsi_concur;          /* concurrency */
-	int                        tsi_loop;            /* loop count */
+	unsigned int		   tsi_is_client:1;	/* is test client */
+	unsigned int		   tsi_stoptsu_onerr:1; /* stop tsu on error */
+	int			   tsi_concur;		/* concurrency */
+	int			   tsi_loop;		/* loop count */
 
 	/* status of test instance */
-	spinlock_t                 tsi_lock;            /* serialize */
-	unsigned int               tsi_stopping:1;      /* test is stopping */
-	atomic_t                   tsi_nactive;         /* # of active test
+	spinlock_t		   tsi_lock;		/* serialize */
+	unsigned int		   tsi_stopping:1;	/* test is stopping */
+	atomic_t		   tsi_nactive;		/* # of active test
 							 * unit */
-	struct list_head           tsi_units;           /* test units */
-	struct list_head           tsi_free_rpcs;       /* free rpcs */
-	struct list_head           tsi_active_rpcs;     /* active rpcs */
+	struct list_head	   tsi_units;		/* test units */
+	struct list_head	   tsi_free_rpcs;	/* free rpcs */
+	struct list_head	   tsi_active_rpcs;	/* active rpcs */
 
 	union {
 		test_ping_req_t	   ping;    /* ping parameter */
@@ -392,24 +392,24 @@ typedef struct sfw_test_instance {
 
 /* XXX: trailing (PAGE_CACHE_SIZE % sizeof(lnet_process_id_t)) bytes at
  * the end of pages are not used */
-#define SFW_MAX_CONCUR     LST_MAX_CONCUR
+#define SFW_MAX_CONCUR	   LST_MAX_CONCUR
 #define SFW_ID_PER_PAGE    (PAGE_CACHE_SIZE / sizeof(lnet_process_id_packed_t))
-#define SFW_MAX_NDESTS     (LNET_MAX_IOV * SFW_ID_PER_PAGE)
+#define SFW_MAX_NDESTS	   (LNET_MAX_IOV * SFW_ID_PER_PAGE)
 #define sfw_id_pages(n)    (((n) + SFW_ID_PER_PAGE - 1) / SFW_ID_PER_PAGE)
 
 typedef struct sfw_test_unit {
-	struct list_head    tsu_list;      /* chain on lst_test_instance */
-	lnet_process_id_t   tsu_dest;      /* id of dest node */
-	int                 tsu_loop;      /* loop count of the test */
+	struct list_head    tsu_list;	   /* chain on lst_test_instance */
+	lnet_process_id_t   tsu_dest;	   /* id of dest node */
+	int		    tsu_loop;	   /* loop count of the test */
 	sfw_test_instance_t *tsu_instance; /* pointer to test instance */
-	void                *tsu_private;  /* private data */
-	swi_workitem_t      tsu_worker;    /* workitem of the test unit */
+	void		    *tsu_private;  /* private data */
+	swi_workitem_t	    tsu_worker;    /* workitem of the test unit */
 } sfw_test_unit_t;
 
 typedef struct sfw_test_case {
-	struct list_head      tsc_list;         /* chain on fw_tests */
-	srpc_service_t        *tsc_srv_service; /* test service */
-	sfw_test_client_ops_t *tsc_cli_ops;     /* ops of test client */
+	struct list_head      tsc_list;		/* chain on fw_tests */
+	srpc_service_t	      *tsc_srv_service; /* test service */
+	sfw_test_client_ops_t *tsc_cli_ops;	/* ops of test client */
 } sfw_test_case_t;
 
 srpc_client_rpc_t *
@@ -511,7 +511,7 @@ srpc_destroy_client_rpc(srpc_client_rpc_t *rpc)
 	if (!rpc->crpc_fini)
 		LIBCFS_FREE(rpc, srpc_client_rpc_size(rpc));
 	else
-		(*rpc->crpc_fini) (rpc);
+		(*rpc->crpc_fini)(rpc);
 }
 
 static inline void
diff --git a/drivers/staging/lustre/lnet/selftest/timer.c b/drivers/staging/lustre/lnet/selftest/timer.c
index f9f37ba..8be5252 100644
--- a/drivers/staging/lustre/lnet/selftest/timer.c
+++ b/drivers/staging/lustre/lnet/selftest/timer.c
@@ -57,13 +57,13 @@
 						    (STTIMER_NSLOTS - 1))])
 
 static struct st_timer_data {
-	spinlock_t        stt_lock;
-	unsigned long     stt_prev_slot; /* start time of the slot processed
+	spinlock_t	  stt_lock;
+	unsigned long	  stt_prev_slot; /* start time of the slot processed
 					  * previously */
 	struct list_head  stt_hash[STTIMER_NSLOTS];
-	int               stt_shuttingdown;
+	int		  stt_shuttingdown;
 	wait_queue_head_t stt_waitq;
-	int               stt_nthreads;
+	int		  stt_nthreads;
 } stt_data;
 
 void
diff --git a/drivers/staging/lustre/lnet/selftest/timer.h b/drivers/staging/lustre/lnet/selftest/timer.h
index 39327bb..f1fbebd 100644
--- a/drivers/staging/lustre/lnet/selftest/timer.h
+++ b/drivers/staging/lustre/lnet/selftest/timer.h
@@ -40,9 +40,9 @@
 
 struct stt_timer {
 	struct list_head stt_list;
-	time64_t         stt_expires;
-	void             (*stt_func)(void *);
-	void             *stt_data;
+	time64_t	 stt_expires;
+	void		 (*stt_func)(void *);
+	void		 *stt_data;
 };
 
 void stt_add_timer(struct stt_timer *timer);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 07/10] staging: lustre: cleanup comment style for lnet selftest
  2016-03-12  1:29 ` [lustre-devel] " James Simmons
@ 2016-03-12  1:29   ` James Simmons
  -1 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

Apply a consistent style for comments in the lnet selftest
code.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/brw_test.c  |    8 ++--
 drivers/staging/lustre/lnet/selftest/conctl.c    |   50 +++++++++++-----------
 drivers/staging/lustre/lnet/selftest/conrpc.c    |   23 +++++-----
 drivers/staging/lustre/lnet/selftest/console.c   |   11 +++--
 drivers/staging/lustre/lnet/selftest/framework.c |   20 ++++----
 drivers/staging/lustre/lnet/selftest/ping_test.c |    2 +-
 drivers/staging/lustre/lnet/selftest/rpc.c       |   46 ++++++++++----------
 drivers/staging/lustre/lnet/selftest/rpc.h       |    2 +-
 drivers/staging/lustre/lnet/selftest/selftest.h  |    3 +-
 drivers/staging/lustre/lnet/selftest/timer.c     |    6 +-
 10 files changed, 87 insertions(+), 84 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c
index eebc924..6ac4d02 100644
--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -86,7 +86,7 @@ brw_client_init(sfw_test_instance_t *tsi)
 		opc = breq->blk_opc;
 		flags = breq->blk_flags;
 		npg = breq->blk_npg;
-		/*
+		/**
 		 * NB: this is not going to work for variable page size,
 		 * but we have to keep it for compatibility
 		 */
@@ -95,7 +95,7 @@ brw_client_init(sfw_test_instance_t *tsi)
 	} else {
 		test_bulk_req_v1_t *breq = &tsi->tsi_u.bulk_v1;
 
-		/*
+		/**
 		 * I should never get this step if it's unknown feature
 		 * because make_session will reject unknown feature
 		 */
@@ -283,7 +283,7 @@ brw_client_prep_rpc(sfw_test_unit_t *tsu,
 	} else {
 		test_bulk_req_v1_t *breq = &tsi->tsi_u.bulk_v1;
 
-		/*
+		/**
 		 * I should never get this step if it's unknown feature
 		 * because make_session will reject unknown feature
 		 */
@@ -329,7 +329,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;
 	}
diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c
index 872df72..d045ac5 100644
--- a/drivers/staging/lustre/lnet/selftest/conctl.c
+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
@@ -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;
@@ -327,7 +327,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 ||
@@ -395,13 +395,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,
@@ -613,18 +613,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,
@@ -723,18 +723,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)
diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index cdb660e..9401e1a 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -60,7 +60,7 @@ lstcon_rpc_done(srpc_client_rpc_t *rpc)
 	spin_lock(&rpc->crpc_lock);
 
 	if (!crpc->crp_trans) {
-		/*
+		/**
 		 * Orphan RPC is not in any transaction,
 		 * I'm just a poor body and nobody loves me
 		 */
@@ -242,7 +242,7 @@ lstcon_rpc_trans_prep(struct list_head *translist,
 
 	if (translist) {
 		list_for_each_entry(trans, translist, tas_link) {
-			/*
+			/**
 			 * Can't enqueue two private transaction on
 			 * the same object
 			 */
@@ -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;
@@ -563,11 +563,11 @@ lstcon_rpc_trans_destroy(lstcon_rpc_trans_t *trans)
 			continue;
 		}
 
-		/*
-		 * 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);
 
@@ -941,7 +941,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;
 		}
@@ -1181,7 +1181,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);
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index 6017f21..25917ac 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -104,7 +104,7 @@ lstcon_node_find(lnet_process_id_t id, lstcon_node_t **ndpp, int create)
 	ndl->ndl_node->nd_timeout = 0;
 	memset(&ndl->ndl_node->nd_ping, 0, sizeof(lstcon_rpc_t));
 
-	/*
+	/**
 	 * queued in global hash & list, no refcount is taken by
 	 * global hash & list, if caller release his refcount,
 	 * node will be released
@@ -276,7 +276,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;
 	}
@@ -608,7 +608,7 @@ lstcon_group_del(char *name)
 	lstcon_rpc_trans_destroy(trans);
 
 	lstcon_group_decref(grp);
-	/*
+	/**
 	 * -ref for session, it's destroyed,
 	 * status can't be rolled back, destroy group anyway
 	 */
@@ -1289,7 +1289,7 @@ lstcon_test_add(char *batch_name, int type, int loop,
 	lstcon_group_t *dst_grp = NULL;
 	lstcon_batch_t *batch = NULL;
 
-	/*
+	/**
 	 * verify that a batch of the given name exists, and the groups
 	 * that will be part of the batch exist and have at least one
 	 * active node
@@ -1447,7 +1447,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 */
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index 2ff47d2..ed2f7e9 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -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);
@@ -382,7 +382,7 @@ sfw_get_stats(srpc_stat_reqst_t *request, srpc_stat_reply_t *reply)
 	lnet_counters_get(&reply->str_lnet);
 	srpc_get_counters(&reply->str_rpc);
 
-	/*
+	/**
 	 * send over the msecs since the session was started
 	 * with 32 bits to send, this is ~49 days
 	 */
@@ -435,7 +435,7 @@ sfw_make_session(srpc_mksn_reqst_t *request, srpc_mksn_reply_t *reply)
 		}
 	}
 
-	/*
+	/**
 	 * reject the request if it requires unknown features
 	 * NB: old version will always accept all features because it's not
 	 * aware of srpc_msg_t::msg_ses_feats, it's a defect but it's also
@@ -576,7 +576,7 @@ sfw_load_test(struct sfw_test_instance *tsi)
 	if (rc) {
 		CWARN("Failed to reserve enough buffers: service %s, %d needed: %d\n",
 		      svc->sv_name, nbuf, rc);
-		/*
+		/**
 		 * NB: this error handler is not strictly correct, because
 		 * it may release more buffers than already allocated,
 		 * but it doesn't matter because request portal should
@@ -604,7 +604,7 @@ sfw_unload_test(struct sfw_test_instance *tsi)
 	if (tsi->tsi_is_client)
 		return;
 
-	/*
+	/**
 	 * shrink buffers, because request portal is lazy portal
 	 * which can grow buffers at runtime so we may leave
 	 * some buffers behind, but never mind...
@@ -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;
 	}
@@ -978,7 +978,7 @@ sfw_run_test(swi_workitem_t *wi)
 	return 0;
 
 test_done:
-	/*
+	/**
 	 * No one can schedule me now since:
 	 * - previous RPC, if any, has done and
 	 * - no new RPC is initiated.
diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c b/drivers/staging/lustre/lnet/selftest/ping_test.c
index 81a4504..e05acce 100644
--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
@@ -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),
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index 69be7d6..83216aa 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -276,7 +276,7 @@ srpc_service_init(struct srpc_service *svc)
 		scd->scd_ev.ev_data = scd;
 		scd->scd_ev.ev_type = SRPC_REQUEST_RCVD;
 
-		/*
+		/**
 		 * NB: don't use lst_sched_serial for adding buffer,
 		 * see details in srpc_service_add_buffers()
 		 */
@@ -284,7 +284,7 @@ srpc_service_init(struct srpc_service *svc)
 				  srpc_add_buffer, lst_sched_test[i]);
 
 		if (i && srpc_serv_is_framework(svc)) {
-			/*
+			/**
 			 * NB: framework service only needs srpc_service_cd for
 			 * one partition, but we allocate for all to make
 			 * it easier to implement, it will waste a little
@@ -415,7 +415,7 @@ srpc_post_active_rdma(int portal, __u64 matchbits, void *buf, int len,
 		return -ENOMEM;
 	}
 
-	/*
+	/**
 	 * this is kind of an abuse of the LNET_MD_OP_{PUT,GET} options.
 	 * they're only meaningful for MDs attached to an ME (i.e. passive
 	 * buffers...
@@ -434,7 +434,7 @@ srpc_post_active_rdma(int portal, __u64 matchbits, void *buf, int len,
 		       options & LNET_MD_OP_PUT ? "Put" : "Get",
 		       libcfs_id2str(peer), portal, matchbits, rc);
 
-		/*
+		/**
 		 * The forthcoming unlink event will complete this operation
 		 * with failure, so fall through and return success here.
 		 */
@@ -479,7 +479,7 @@ __must_hold(&scd->scd_lock)
 				      msg, sizeof(*msg), &buf->buf_mdh,
 				      &scd->scd_ev);
 
-	/*
+	/**
 	 * At this point, a RPC (new or delayed) may have arrived in
 	 * msg and its event handler has been called. So we must add
 	 * buf to scd_buf_posted _before_ dropping scd_lock
@@ -491,7 +491,7 @@ __must_hold(&scd->scd_lock)
 			return 0;
 
 		spin_unlock(&scd->scd_lock);
-		/*
+		/**
 		 * srpc_shutdown_service might have tried to unlink me
 		 * when my buf_mdh was still invalid
 		 */
@@ -520,7 +520,7 @@ srpc_add_buffer(struct swi_workitem *wi)
 	struct srpc_buffer *buf;
 	int rc = 0;
 
-	/*
+	/**
 	 * it's called by workitem scheduler threads, these threads
 	 * should have been set CPT affinity, so buffers will be posted
 	 * on CPT local list of Portal
@@ -602,7 +602,7 @@ srpc_service_add_buffers(struct srpc_service *sv, int nbuffer)
 
 	cfs_percpt_for_each(scd, i, sv->sv_cpt_data) {
 		spin_lock(&scd->scd_lock);
-		/*
+		/**
 		 * NB: srpc_service_add_buffers() can be called inside
 		 * thread context of lst_sched_serial, and we don't normally
 		 * allow to sleep inside thread context of WI scheduler
@@ -740,7 +740,7 @@ srpc_abort_service(struct srpc_service *sv)
 	cfs_percpt_for_each(scd, i, sv->sv_cpt_data) {
 		spin_lock(&scd->scd_lock);
 
-		/*
+		/**
 		 * schedule in-flight RPCs to notice the abort, NB:
 		 * racing with incoming RPCs; complete fix should make test
 		 * RPCs carry session ID in its headers
@@ -782,7 +782,7 @@ srpc_shutdown_service(srpc_service_t *sv)
 
 		spin_unlock(&scd->scd_lock);
 
-		/*
+		/**
 		 * OK to traverse scd_buf_posted without lock, since no one
 		 * touches scd_buf_posted now
 		 */
@@ -927,7 +927,7 @@ srpc_server_rpc_done(struct srpc_server_rpc *rpc, int status)
 	spin_lock(&scd->scd_lock);
 
 	if (rpc->srpc_reqstbuf) {
-		/*
+		/**
 		 * NB might drop sv_lock in srpc_service_recycle_buffer, but
 		 * sv won't go away for scd_rpc_active must not be empty
 		 */
@@ -937,7 +937,7 @@ srpc_server_rpc_done(struct srpc_server_rpc *rpc, int status)
 
 	list_del(&rpc->srpc_list); /* from scd->scd_rpc_active */
 
-	/*
+	/**
 	 * No one can schedule me now since:
 	 * - I'm not on scd_rpc_active.
 	 * - all LNet events have been fired.
@@ -1110,7 +1110,7 @@ srpc_add_client_rpc_timer(srpc_client_rpc_t *rpc)
 	stt_add_timer(timer);
 }
 
-/*
+/**
  * Called with rpc->crpc_lock held.
  *
  * Upon exit the RPC expiry timer is not queued and the handler is not
@@ -1157,7 +1157,7 @@ srpc_client_rpc_done(srpc_client_rpc_t *rpc, int status)
 		     rpc->crpc_service, libcfs_id2str(rpc->crpc_dest),
 		     swi_state2str(wi->swi_state), rpc->crpc_aborted, status);
 
-	/*
+	/**
 	 * No one can schedule me now since:
 	 * - RPC timer has been defused.
 	 * - all LNet events have been fired.
@@ -1222,7 +1222,7 @@ srpc_send_rpc(swi_workitem_t *wi)
 		break;
 
 	case SWI_STATE_REQUEST_SUBMITTED:
-		/*
+		/**
 		 * CAVEAT EMPTOR: rqtev, rpyev, and bulkev may come in any
 		 * order; however, they're processed in a strict order:
 		 * rqt, rpy, and bulk.
@@ -1273,7 +1273,7 @@ srpc_send_rpc(swi_workitem_t *wi)
 
 		rc = do_bulk ? rpc->crpc_bulkev.ev_status : 0;
 
-		/*
+		/**
 		 * Bulk buffer was unlinked due to remote error. Clear error
 		 * since reply buffer still contains valid data.
 		 * NB rpc->crpc_done shouldn't look into bulk data in case of
@@ -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",
@@ -1377,7 +1377,7 @@ srpc_send_reply(struct srpc_server_rpc *rpc)
 	spin_lock(&scd->scd_lock);
 
 	if (!sv->sv_shuttingdown && !srpc_serv_is_framework(sv)) {
-		/*
+		/**
 		 * Repost buffer before replying since test client
 		 * might send me another RPC once it gets the reply
 		 */
@@ -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;
 }
 
@@ -1494,7 +1494,7 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
 		scd->scd_buf_nposted--;
 
 		if (sv->sv_shuttingdown) {
-			/*
+			/**
 			 * Leave buffer on scd->scd_buf_nposted since
 			 * srpc_finish_service needs to traverse it.
 			 */
@@ -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,
@@ -1531,7 +1531,7 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
 			       ev->status, ev->mlength,
 			       msg->msg_type, msg->msg_magic);
 
-			/*
+			/**
 			 * NB can't call srpc_service_recycle_buffer here since
 			 * it may call LNetM[DE]Attach. The invalid magic tells
 			 * srpc_handle_rpc to drop this RPC
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.h b/drivers/staging/lustre/lnet/selftest/rpc.h
index a79c315..7cbf19d 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.h
+++ b/drivers/staging/lustre/lnet/selftest/rpc.h
@@ -281,7 +281,7 @@ srpc_unpack_msg_hdr(srpc_msg_t *msg)
 	if (msg->msg_magic == SRPC_MSG_MAGIC)
 		return; /* no flipping needed */
 
-	/*
+	/**
 	 * We do not swap the magic number here as it is needed to
 	 * determine whether the body needs to be swapped.
 	 */
diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h
index 288522d..b1460f3 100644
--- a/drivers/staging/lustre/lnet/selftest/selftest.h
+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
@@ -71,7 +71,8 @@ struct srpc_service_cd;
 struct sfw_test_unit;
 struct sfw_test_instance;
 
-/* services below SRPC_FRAMEWORK_SERVICE_MAX_ID are framework
+/**
+ * services below SRPC_FRAMEWORK_SERVICE_MAX_ID are framework
  * services, e.g. create/modify session.
  */
 #define SRPC_SERVICE_DEBUG		0
diff --git a/drivers/staging/lustre/lnet/selftest/timer.c b/drivers/staging/lustre/lnet/selftest/timer.c
index 8be5252..3e83442 100644
--- a/drivers/staging/lustre/lnet/selftest/timer.c
+++ b/drivers/staging/lustre/lnet/selftest/timer.c
@@ -42,14 +42,14 @@
 
 #include "selftest.h"
 
-/*
+/**
  * Timers are implemented as a sorted queue of expiry times. The queue
  * is slotted, with each slot holding timers which expire in a
  * 2**STTIMER_MINPOLL (8) second period. The timers in each slot are
  * 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)
@@ -92,7 +92,7 @@ stt_add_timer(struct stt_timer *timer)
 	spin_unlock(&stt_data.stt_lock);
 }
 
-/*
+/**
  * The function returns whether it has deactivated a pending timer or not.
  * (ie. del_timer() of an inactive timer returns 0, del_timer() of an
  * active timer returns 1.)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 07/10] staging: lustre: cleanup comment style for lnet selftest
@ 2016-03-12  1:29   ` James Simmons
  0 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

Apply a consistent style for comments in the lnet selftest
code.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/brw_test.c  |    8 ++--
 drivers/staging/lustre/lnet/selftest/conctl.c    |   50 +++++++++++-----------
 drivers/staging/lustre/lnet/selftest/conrpc.c    |   23 +++++-----
 drivers/staging/lustre/lnet/selftest/console.c   |   11 +++--
 drivers/staging/lustre/lnet/selftest/framework.c |   20 ++++----
 drivers/staging/lustre/lnet/selftest/ping_test.c |    2 +-
 drivers/staging/lustre/lnet/selftest/rpc.c       |   46 ++++++++++----------
 drivers/staging/lustre/lnet/selftest/rpc.h       |    2 +-
 drivers/staging/lustre/lnet/selftest/selftest.h  |    3 +-
 drivers/staging/lustre/lnet/selftest/timer.c     |    6 +-
 10 files changed, 87 insertions(+), 84 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c
index eebc924..6ac4d02 100644
--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -86,7 +86,7 @@ brw_client_init(sfw_test_instance_t *tsi)
 		opc = breq->blk_opc;
 		flags = breq->blk_flags;
 		npg = breq->blk_npg;
-		/*
+		/**
 		 * NB: this is not going to work for variable page size,
 		 * but we have to keep it for compatibility
 		 */
@@ -95,7 +95,7 @@ brw_client_init(sfw_test_instance_t *tsi)
 	} else {
 		test_bulk_req_v1_t *breq = &tsi->tsi_u.bulk_v1;
 
-		/*
+		/**
 		 * I should never get this step if it's unknown feature
 		 * because make_session will reject unknown feature
 		 */
@@ -283,7 +283,7 @@ brw_client_prep_rpc(sfw_test_unit_t *tsu,
 	} else {
 		test_bulk_req_v1_t *breq = &tsi->tsi_u.bulk_v1;
 
-		/*
+		/**
 		 * I should never get this step if it's unknown feature
 		 * because make_session will reject unknown feature
 		 */
@@ -329,7 +329,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;
 	}
diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c
index 872df72..d045ac5 100644
--- a/drivers/staging/lustre/lnet/selftest/conctl.c
+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
@@ -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;
@@ -327,7 +327,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 ||
@@ -395,13 +395,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,
@@ -613,18 +613,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,
@@ -723,18 +723,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)
diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index cdb660e..9401e1a 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -60,7 +60,7 @@ lstcon_rpc_done(srpc_client_rpc_t *rpc)
 	spin_lock(&rpc->crpc_lock);
 
 	if (!crpc->crp_trans) {
-		/*
+		/**
 		 * Orphan RPC is not in any transaction,
 		 * I'm just a poor body and nobody loves me
 		 */
@@ -242,7 +242,7 @@ lstcon_rpc_trans_prep(struct list_head *translist,
 
 	if (translist) {
 		list_for_each_entry(trans, translist, tas_link) {
-			/*
+			/**
 			 * Can't enqueue two private transaction on
 			 * the same object
 			 */
@@ -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;
@@ -563,11 +563,11 @@ lstcon_rpc_trans_destroy(lstcon_rpc_trans_t *trans)
 			continue;
 		}
 
-		/*
-		 * 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);
 
@@ -941,7 +941,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;
 		}
@@ -1181,7 +1181,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);
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index 6017f21..25917ac 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -104,7 +104,7 @@ lstcon_node_find(lnet_process_id_t id, lstcon_node_t **ndpp, int create)
 	ndl->ndl_node->nd_timeout = 0;
 	memset(&ndl->ndl_node->nd_ping, 0, sizeof(lstcon_rpc_t));
 
-	/*
+	/**
 	 * queued in global hash & list, no refcount is taken by
 	 * global hash & list, if caller release his refcount,
 	 * node will be released
@@ -276,7 +276,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;
 	}
@@ -608,7 +608,7 @@ lstcon_group_del(char *name)
 	lstcon_rpc_trans_destroy(trans);
 
 	lstcon_group_decref(grp);
-	/*
+	/**
 	 * -ref for session, it's destroyed,
 	 * status can't be rolled back, destroy group anyway
 	 */
@@ -1289,7 +1289,7 @@ lstcon_test_add(char *batch_name, int type, int loop,
 	lstcon_group_t *dst_grp = NULL;
 	lstcon_batch_t *batch = NULL;
 
-	/*
+	/**
 	 * verify that a batch of the given name exists, and the groups
 	 * that will be part of the batch exist and have at least one
 	 * active node
@@ -1447,7 +1447,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 */
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index 2ff47d2..ed2f7e9 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -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);
@@ -382,7 +382,7 @@ sfw_get_stats(srpc_stat_reqst_t *request, srpc_stat_reply_t *reply)
 	lnet_counters_get(&reply->str_lnet);
 	srpc_get_counters(&reply->str_rpc);
 
-	/*
+	/**
 	 * send over the msecs since the session was started
 	 * with 32 bits to send, this is ~49 days
 	 */
@@ -435,7 +435,7 @@ sfw_make_session(srpc_mksn_reqst_t *request, srpc_mksn_reply_t *reply)
 		}
 	}
 
-	/*
+	/**
 	 * reject the request if it requires unknown features
 	 * NB: old version will always accept all features because it's not
 	 * aware of srpc_msg_t::msg_ses_feats, it's a defect but it's also
@@ -576,7 +576,7 @@ sfw_load_test(struct sfw_test_instance *tsi)
 	if (rc) {
 		CWARN("Failed to reserve enough buffers: service %s, %d needed: %d\n",
 		      svc->sv_name, nbuf, rc);
-		/*
+		/**
 		 * NB: this error handler is not strictly correct, because
 		 * it may release more buffers than already allocated,
 		 * but it doesn't matter because request portal should
@@ -604,7 +604,7 @@ sfw_unload_test(struct sfw_test_instance *tsi)
 	if (tsi->tsi_is_client)
 		return;
 
-	/*
+	/**
 	 * shrink buffers, because request portal is lazy portal
 	 * which can grow buffers at runtime so we may leave
 	 * some buffers behind, but never mind...
@@ -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;
 	}
@@ -978,7 +978,7 @@ sfw_run_test(swi_workitem_t *wi)
 	return 0;
 
 test_done:
-	/*
+	/**
 	 * No one can schedule me now since:
 	 * - previous RPC, if any, has done and
 	 * - no new RPC is initiated.
diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c b/drivers/staging/lustre/lnet/selftest/ping_test.c
index 81a4504..e05acce 100644
--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
@@ -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),
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index 69be7d6..83216aa 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -276,7 +276,7 @@ srpc_service_init(struct srpc_service *svc)
 		scd->scd_ev.ev_data = scd;
 		scd->scd_ev.ev_type = SRPC_REQUEST_RCVD;
 
-		/*
+		/**
 		 * NB: don't use lst_sched_serial for adding buffer,
 		 * see details in srpc_service_add_buffers()
 		 */
@@ -284,7 +284,7 @@ srpc_service_init(struct srpc_service *svc)
 				  srpc_add_buffer, lst_sched_test[i]);
 
 		if (i && srpc_serv_is_framework(svc)) {
-			/*
+			/**
 			 * NB: framework service only needs srpc_service_cd for
 			 * one partition, but we allocate for all to make
 			 * it easier to implement, it will waste a little
@@ -415,7 +415,7 @@ srpc_post_active_rdma(int portal, __u64 matchbits, void *buf, int len,
 		return -ENOMEM;
 	}
 
-	/*
+	/**
 	 * this is kind of an abuse of the LNET_MD_OP_{PUT,GET} options.
 	 * they're only meaningful for MDs attached to an ME (i.e. passive
 	 * buffers...
@@ -434,7 +434,7 @@ srpc_post_active_rdma(int portal, __u64 matchbits, void *buf, int len,
 		       options & LNET_MD_OP_PUT ? "Put" : "Get",
 		       libcfs_id2str(peer), portal, matchbits, rc);
 
-		/*
+		/**
 		 * The forthcoming unlink event will complete this operation
 		 * with failure, so fall through and return success here.
 		 */
@@ -479,7 +479,7 @@ __must_hold(&scd->scd_lock)
 				      msg, sizeof(*msg), &buf->buf_mdh,
 				      &scd->scd_ev);
 
-	/*
+	/**
 	 * At this point, a RPC (new or delayed) may have arrived in
 	 * msg and its event handler has been called. So we must add
 	 * buf to scd_buf_posted _before_ dropping scd_lock
@@ -491,7 +491,7 @@ __must_hold(&scd->scd_lock)
 			return 0;
 
 		spin_unlock(&scd->scd_lock);
-		/*
+		/**
 		 * srpc_shutdown_service might have tried to unlink me
 		 * when my buf_mdh was still invalid
 		 */
@@ -520,7 +520,7 @@ srpc_add_buffer(struct swi_workitem *wi)
 	struct srpc_buffer *buf;
 	int rc = 0;
 
-	/*
+	/**
 	 * it's called by workitem scheduler threads, these threads
 	 * should have been set CPT affinity, so buffers will be posted
 	 * on CPT local list of Portal
@@ -602,7 +602,7 @@ srpc_service_add_buffers(struct srpc_service *sv, int nbuffer)
 
 	cfs_percpt_for_each(scd, i, sv->sv_cpt_data) {
 		spin_lock(&scd->scd_lock);
-		/*
+		/**
 		 * NB: srpc_service_add_buffers() can be called inside
 		 * thread context of lst_sched_serial, and we don't normally
 		 * allow to sleep inside thread context of WI scheduler
@@ -740,7 +740,7 @@ srpc_abort_service(struct srpc_service *sv)
 	cfs_percpt_for_each(scd, i, sv->sv_cpt_data) {
 		spin_lock(&scd->scd_lock);
 
-		/*
+		/**
 		 * schedule in-flight RPCs to notice the abort, NB:
 		 * racing with incoming RPCs; complete fix should make test
 		 * RPCs carry session ID in its headers
@@ -782,7 +782,7 @@ srpc_shutdown_service(srpc_service_t *sv)
 
 		spin_unlock(&scd->scd_lock);
 
-		/*
+		/**
 		 * OK to traverse scd_buf_posted without lock, since no one
 		 * touches scd_buf_posted now
 		 */
@@ -927,7 +927,7 @@ srpc_server_rpc_done(struct srpc_server_rpc *rpc, int status)
 	spin_lock(&scd->scd_lock);
 
 	if (rpc->srpc_reqstbuf) {
-		/*
+		/**
 		 * NB might drop sv_lock in srpc_service_recycle_buffer, but
 		 * sv won't go away for scd_rpc_active must not be empty
 		 */
@@ -937,7 +937,7 @@ srpc_server_rpc_done(struct srpc_server_rpc *rpc, int status)
 
 	list_del(&rpc->srpc_list); /* from scd->scd_rpc_active */
 
-	/*
+	/**
 	 * No one can schedule me now since:
 	 * - I'm not on scd_rpc_active.
 	 * - all LNet events have been fired.
@@ -1110,7 +1110,7 @@ srpc_add_client_rpc_timer(srpc_client_rpc_t *rpc)
 	stt_add_timer(timer);
 }
 
-/*
+/**
  * Called with rpc->crpc_lock held.
  *
  * Upon exit the RPC expiry timer is not queued and the handler is not
@@ -1157,7 +1157,7 @@ srpc_client_rpc_done(srpc_client_rpc_t *rpc, int status)
 		     rpc->crpc_service, libcfs_id2str(rpc->crpc_dest),
 		     swi_state2str(wi->swi_state), rpc->crpc_aborted, status);
 
-	/*
+	/**
 	 * No one can schedule me now since:
 	 * - RPC timer has been defused.
 	 * - all LNet events have been fired.
@@ -1222,7 +1222,7 @@ srpc_send_rpc(swi_workitem_t *wi)
 		break;
 
 	case SWI_STATE_REQUEST_SUBMITTED:
-		/*
+		/**
 		 * CAVEAT EMPTOR: rqtev, rpyev, and bulkev may come in any
 		 * order; however, they're processed in a strict order:
 		 * rqt, rpy, and bulk.
@@ -1273,7 +1273,7 @@ srpc_send_rpc(swi_workitem_t *wi)
 
 		rc = do_bulk ? rpc->crpc_bulkev.ev_status : 0;
 
-		/*
+		/**
 		 * Bulk buffer was unlinked due to remote error. Clear error
 		 * since reply buffer still contains valid data.
 		 * NB rpc->crpc_done shouldn't look into bulk data in case of
@@ -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",
@@ -1377,7 +1377,7 @@ srpc_send_reply(struct srpc_server_rpc *rpc)
 	spin_lock(&scd->scd_lock);
 
 	if (!sv->sv_shuttingdown && !srpc_serv_is_framework(sv)) {
-		/*
+		/**
 		 * Repost buffer before replying since test client
 		 * might send me another RPC once it gets the reply
 		 */
@@ -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;
 }
 
@@ -1494,7 +1494,7 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
 		scd->scd_buf_nposted--;
 
 		if (sv->sv_shuttingdown) {
-			/*
+			/**
 			 * Leave buffer on scd->scd_buf_nposted since
 			 * srpc_finish_service needs to traverse it.
 			 */
@@ -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,
@@ -1531,7 +1531,7 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
 			       ev->status, ev->mlength,
 			       msg->msg_type, msg->msg_magic);
 
-			/*
+			/**
 			 * NB can't call srpc_service_recycle_buffer here since
 			 * it may call LNetM[DE]Attach. The invalid magic tells
 			 * srpc_handle_rpc to drop this RPC
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.h b/drivers/staging/lustre/lnet/selftest/rpc.h
index a79c315..7cbf19d 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.h
+++ b/drivers/staging/lustre/lnet/selftest/rpc.h
@@ -281,7 +281,7 @@ srpc_unpack_msg_hdr(srpc_msg_t *msg)
 	if (msg->msg_magic == SRPC_MSG_MAGIC)
 		return; /* no flipping needed */
 
-	/*
+	/**
 	 * We do not swap the magic number here as it is needed to
 	 * determine whether the body needs to be swapped.
 	 */
diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h
index 288522d..b1460f3 100644
--- a/drivers/staging/lustre/lnet/selftest/selftest.h
+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
@@ -71,7 +71,8 @@ struct srpc_service_cd;
 struct sfw_test_unit;
 struct sfw_test_instance;
 
-/* services below SRPC_FRAMEWORK_SERVICE_MAX_ID are framework
+/**
+ * services below SRPC_FRAMEWORK_SERVICE_MAX_ID are framework
  * services, e.g. create/modify session.
  */
 #define SRPC_SERVICE_DEBUG		0
diff --git a/drivers/staging/lustre/lnet/selftest/timer.c b/drivers/staging/lustre/lnet/selftest/timer.c
index 8be5252..3e83442 100644
--- a/drivers/staging/lustre/lnet/selftest/timer.c
+++ b/drivers/staging/lustre/lnet/selftest/timer.c
@@ -42,14 +42,14 @@
 
 #include "selftest.h"
 
-/*
+/**
  * Timers are implemented as a sorted queue of expiry times. The queue
  * is slotted, with each slot holding timers which expire in a
  * 2**STTIMER_MINPOLL (8) second period. The timers in each slot are
  * 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)
@@ -92,7 +92,7 @@ stt_add_timer(struct stt_timer *timer)
 	spin_unlock(&stt_data.stt_lock);
 }
 
-/*
+/**
  * The function returns whether it has deactivated a pending timer or not.
  * (ie. del_timer() of an inactive timer returns 0, del_timer() of an
  * active timer returns 1.)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 08/10] staging: lustre: test for proper errno code in lstcon_rpc_trans_abort
  2016-03-12  1:29 ` [lustre-devel] " James Simmons
@ 2016-03-12  1:29   ` James Simmons
  -1 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

The error value returned will be -ETIMEDOUT not ETIMEDOUT. This fixes
a typo that prevents us from handling the error case.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/conrpc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index 9401e1a..db5a0dc 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -313,7 +313,7 @@ lstcon_rpc_trans_abort(lstcon_rpc_trans_t *trans, int error)
 
 		sfw_abort_rpc(rpc);
 
-		if (error != ETIMEDOUT)
+		if (error != -ETIMEDOUT)
 			continue;
 
 		nd = crpc->crp_node;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 08/10] staging: lustre: test for proper errno code in lstcon_rpc_trans_abort
@ 2016-03-12  1:29   ` James Simmons
  0 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

The error value returned will be -ETIMEDOUT not ETIMEDOUT. This fixes
a typo that prevents us from handling the error case.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/conrpc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index 9401e1a..db5a0dc 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -313,7 +313,7 @@ lstcon_rpc_trans_abort(lstcon_rpc_trans_t *trans, int error)
 
 		sfw_abort_rpc(rpc);
 
-		if (error != ETIMEDOUT)
+		if (error != -ETIMEDOUT)
 			continue;
 
 		nd = crpc->crp_node;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 09/10] staging: lustre: report minimum of two buffers for LNet selftest load test
  2016-03-12  1:29 ` [lustre-devel] " James Simmons
@ 2016-03-12  1:29   ` James Simmons
  -1 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

The minimum number reserve buffer for lnet selftest load test is two
not one.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/framework.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index ed2f7e9..54ad6d8 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -588,7 +588,7 @@ sfw_load_test(struct sfw_test_instance *tsi)
 
 	CDEBUG(D_NET, "Reserved %d buffers for test %s\n",
 	       nbuf * (srpc_serv_is_framework(svc) ?
-		       1 : cfs_cpt_number(cfs_cpt_table)), svc->sv_name);
+		       2 : cfs_cpt_number(cfs_cpt_table)), svc->sv_name);
 	return 0;
 }
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 09/10] staging: lustre: report minimum of two buffers for LNet selftest load test
@ 2016-03-12  1:29   ` James Simmons
  0 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

The minimum number reserve buffer for lnet selftest load test is two
not one.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/framework.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index ed2f7e9..54ad6d8 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -588,7 +588,7 @@ sfw_load_test(struct sfw_test_instance *tsi)
 
 	CDEBUG(D_NET, "Reserved %d buffers for test %s\n",
 	       nbuf * (srpc_serv_is_framework(svc) ?
-		       1 : cfs_cpt_number(cfs_cpt_table)), svc->sv_name);
+		       2 : cfs_cpt_number(cfs_cpt_table)), svc->sv_name);
 	return 0;
 }
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 10/10] staging: lustre: fix aligments in lnet selftest
  2016-03-12  1:29 ` [lustre-devel] " James Simmons
@ 2016-03-12  1:29   ` James Simmons
  -1 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

Some aligment issues were not caught by checkpatch. We address them
here. Some of the alignment issues caused greater than 80 character
checkpatch issues. Some changes were done to just make the code more
readable and to match our production code.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/conctl.c    |   10 +++++-----
 drivers/staging/lustre/lnet/selftest/conrpc.c    |   11 +++++------
 drivers/staging/lustre/lnet/selftest/console.c   |    7 ++++---
 drivers/staging/lustre/lnet/selftest/framework.c |    5 ++---
 drivers/staging/lustre/lnet/selftest/module.c    |    3 +--
 5 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c
index d045ac5..6e2a81d 100644
--- a/drivers/staging/lustre/lnet/selftest/conctl.c
+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
@@ -278,8 +278,7 @@ lst_group_update_ioctl(lstio_group_update_args_t *args)
 	if (!name)
 		return -ENOMEM;
 
-	if (copy_from_user(name,
-			   args->lstio_grp_namep,
+	if (copy_from_user(name, args->lstio_grp_namep,
 			   args->lstio_grp_nmlen)) {
 		LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
 		return -EFAULT;
@@ -375,8 +374,8 @@ lst_group_list_ioctl(lstio_group_list_args_t *args)
 		return -EINVAL;
 
 	return lstcon_group_list(args->lstio_grp_idx,
-			      args->lstio_grp_nmlen,
-			      args->lstio_grp_namep);
+				 args->lstio_grp_nmlen,
+				 args->lstio_grp_namep);
 }
 
 static int
@@ -743,7 +742,8 @@ static int lst_test_add_ioctl(lstio_test_args_t *args)
 	/* have parameter, check if parameter length is valid */
 	if (args->lstio_tes_param &&
 	    (args->lstio_tes_param_len <= 0 ||
-	     args->lstio_tes_param_len > PAGE_CACHE_SIZE - sizeof(lstcon_test_t)))
+	     args->lstio_tes_param_len >
+	     PAGE_CACHE_SIZE - sizeof(lstcon_test_t)))
 		return -EINVAL;
 
 	LIBCFS_ALLOC(batch_name, args->lstio_tes_bat_nmlen + 1);
diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index db5a0dc..15b3b00 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -235,8 +235,8 @@ lstcon_rpc_trans_name(int transop)
 }
 
 int
-lstcon_rpc_trans_prep(struct list_head *translist,
-		      int transop, lstcon_rpc_trans_t **transpp)
+lstcon_rpc_trans_prep(struct list_head *translist, int transop,
+		      lstcon_rpc_trans_t **transpp)
 {
 	lstcon_rpc_trans_t *trans;
 
@@ -547,8 +547,7 @@ lstcon_rpc_trans_destroy(lstcon_rpc_trans_t *trans)
 	lstcon_rpc_t *tmp;
 	int count = 0;
 
-	list_for_each_entry_safe(crpc, tmp, &trans->tas_rpcs_list,
-				 crp_link) {
+	list_for_each_entry_safe(crpc, tmp, &trans->tas_rpcs_list, crp_link) {
 		rpc = crpc->crp_rpc;
 
 		spin_lock(&rpc->crpc_lock);
@@ -668,8 +667,8 @@ lstcon_batrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 	brq->bar_bid = tsb->tsb_id;
 	brq->bar_testidx = tsb->tsb_index;
 	brq->bar_opc = transop == LST_TRANS_TSBRUN ? SRPC_BATCH_OPC_RUN :
-			   (transop == LST_TRANS_TSBSTOP ? SRPC_BATCH_OPC_STOP :
-			    SRPC_BATCH_OPC_QUERY);
+		       (transop == LST_TRANS_TSBSTOP ? SRPC_BATCH_OPC_STOP :
+		       SRPC_BATCH_OPC_QUERY);
 
 	if (transop != LST_TRANS_TSBRUN &&
 	    transop != LST_TRANS_TSBSTOP)
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index 25917ac..fa6d5e7 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -76,7 +76,8 @@ lstcon_node_find(lnet_process_id_t id, lstcon_node_t **ndpp, int create)
 
 	LASSERT(id.nid != LNET_NID_ANY);
 
-	list_for_each_entry(ndl, &console_session.ses_ndl_hash[idx], ndl_hlink) {
+	list_for_each_entry(ndl, &console_session.ses_ndl_hash[idx],
+			    ndl_hlink) {
 		if (ndl->ndl_node->nd_id.nid != id.nid ||
 		    ndl->ndl_node->nd_id.pid != id.pid)
 			continue;
@@ -316,7 +317,7 @@ lstcon_group_ndlink_move(lstcon_group_t *old,
 			 lstcon_group_t *new, lstcon_ndlink_t *ndl)
 {
 	unsigned int idx = LNET_NIDADDR(ndl->ndl_node->nd_id.nid) %
-			   LST_NODE_HASHSIZE;
+					LST_NODE_HASHSIZE;
 
 	list_del(&ndl->ndl_hlink);
 	list_del(&ndl->ndl_link);
@@ -918,7 +919,7 @@ lstcon_batch_list(int index, int len, char __user *name_up)
 	list_for_each_entry(bat, &console_session.ses_bat_list, bat_link) {
 		if (!index--) {
 			return copy_to_user(name_up, bat->bat_name, len) ?
-			       -EFAULT : 0;
+					    -EFAULT : 0;
 		}
 	}
 
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index 54ad6d8..b6fe1ab 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -406,7 +406,7 @@ sfw_make_session(srpc_mksn_reqst_t *request, srpc_mksn_reply_t *reply)
 {
 	sfw_session_t *sn = sfw_data.fw_session;
 	srpc_msg_t *msg = container_of(request, srpc_msg_t,
-					  msg_body.mksn_reqst);
+				       msg_body.mksn_reqst);
 	int cplen = 0;
 
 	if (request->mksn_sid.ses_nid == LNET_NID_ANY) {
@@ -1017,8 +1017,7 @@ sfw_run_batch(sfw_batch_t *tsb)
 			tsu->tsu_loop = tsi->tsi_loop;
 			wi = &tsu->tsu_worker;
 			swi_init_workitem(wi, tsu, sfw_run_test,
-					  lst_sched_test[\
-					  lnet_cpt_of_nid(tsu->tsu_dest.nid)]);
+					  lst_sched_test[lnet_cpt_of_nid(tsu->tsu_dest.nid)]);
 			swi_schedule_workitem(wi);
 		}
 	}
diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/lustre/lnet/selftest/module.c
index 1e858e9..cc046b1 100644
--- a/drivers/staging/lustre/lnet/selftest/module.c
+++ b/drivers/staging/lustre/lnet/selftest/module.c
@@ -116,8 +116,7 @@ lnet_selftest_init(void)
 		rc = cfs_wi_sched_create("lst_t", lnet_cpt_table(), i,
 					 nthrs, &lst_sched_test[i]);
 		if (rc) {
-			CERROR("Failed to create CPT affinity WI scheduler %d for LST\n",
-			       i);
+			CERROR("Failed to create CPT affinity WI scheduler %d for LST\n", i);
 			goto error;
 		}
 	}
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 10/10] staging: lustre: fix aligments in lnet selftest
@ 2016-03-12  1:29   ` James Simmons
  0 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2016-03-12  1:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger, Oleg Drokin
  Cc: Linux Kernel Mailing List, Lustre Development List, James Simmons

Some aligment issues were not caught by checkpatch. We address them
here. Some of the alignment issues caused greater than 80 character
checkpatch issues. Some changes were done to just make the code more
readable and to match our production code.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/conctl.c    |   10 +++++-----
 drivers/staging/lustre/lnet/selftest/conrpc.c    |   11 +++++------
 drivers/staging/lustre/lnet/selftest/console.c   |    7 ++++---
 drivers/staging/lustre/lnet/selftest/framework.c |    5 ++---
 drivers/staging/lustre/lnet/selftest/module.c    |    3 +--
 5 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c
index d045ac5..6e2a81d 100644
--- a/drivers/staging/lustre/lnet/selftest/conctl.c
+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
@@ -278,8 +278,7 @@ lst_group_update_ioctl(lstio_group_update_args_t *args)
 	if (!name)
 		return -ENOMEM;
 
-	if (copy_from_user(name,
-			   args->lstio_grp_namep,
+	if (copy_from_user(name, args->lstio_grp_namep,
 			   args->lstio_grp_nmlen)) {
 		LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
 		return -EFAULT;
@@ -375,8 +374,8 @@ lst_group_list_ioctl(lstio_group_list_args_t *args)
 		return -EINVAL;
 
 	return lstcon_group_list(args->lstio_grp_idx,
-			      args->lstio_grp_nmlen,
-			      args->lstio_grp_namep);
+				 args->lstio_grp_nmlen,
+				 args->lstio_grp_namep);
 }
 
 static int
@@ -743,7 +742,8 @@ static int lst_test_add_ioctl(lstio_test_args_t *args)
 	/* have parameter, check if parameter length is valid */
 	if (args->lstio_tes_param &&
 	    (args->lstio_tes_param_len <= 0 ||
-	     args->lstio_tes_param_len > PAGE_CACHE_SIZE - sizeof(lstcon_test_t)))
+	     args->lstio_tes_param_len >
+	     PAGE_CACHE_SIZE - sizeof(lstcon_test_t)))
 		return -EINVAL;
 
 	LIBCFS_ALLOC(batch_name, args->lstio_tes_bat_nmlen + 1);
diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index db5a0dc..15b3b00 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -235,8 +235,8 @@ lstcon_rpc_trans_name(int transop)
 }
 
 int
-lstcon_rpc_trans_prep(struct list_head *translist,
-		      int transop, lstcon_rpc_trans_t **transpp)
+lstcon_rpc_trans_prep(struct list_head *translist, int transop,
+		      lstcon_rpc_trans_t **transpp)
 {
 	lstcon_rpc_trans_t *trans;
 
@@ -547,8 +547,7 @@ lstcon_rpc_trans_destroy(lstcon_rpc_trans_t *trans)
 	lstcon_rpc_t *tmp;
 	int count = 0;
 
-	list_for_each_entry_safe(crpc, tmp, &trans->tas_rpcs_list,
-				 crp_link) {
+	list_for_each_entry_safe(crpc, tmp, &trans->tas_rpcs_list, crp_link) {
 		rpc = crpc->crp_rpc;
 
 		spin_lock(&rpc->crpc_lock);
@@ -668,8 +667,8 @@ lstcon_batrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
 	brq->bar_bid = tsb->tsb_id;
 	brq->bar_testidx = tsb->tsb_index;
 	brq->bar_opc = transop == LST_TRANS_TSBRUN ? SRPC_BATCH_OPC_RUN :
-			   (transop == LST_TRANS_TSBSTOP ? SRPC_BATCH_OPC_STOP :
-			    SRPC_BATCH_OPC_QUERY);
+		       (transop == LST_TRANS_TSBSTOP ? SRPC_BATCH_OPC_STOP :
+		       SRPC_BATCH_OPC_QUERY);
 
 	if (transop != LST_TRANS_TSBRUN &&
 	    transop != LST_TRANS_TSBSTOP)
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index 25917ac..fa6d5e7 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -76,7 +76,8 @@ lstcon_node_find(lnet_process_id_t id, lstcon_node_t **ndpp, int create)
 
 	LASSERT(id.nid != LNET_NID_ANY);
 
-	list_for_each_entry(ndl, &console_session.ses_ndl_hash[idx], ndl_hlink) {
+	list_for_each_entry(ndl, &console_session.ses_ndl_hash[idx],
+			    ndl_hlink) {
 		if (ndl->ndl_node->nd_id.nid != id.nid ||
 		    ndl->ndl_node->nd_id.pid != id.pid)
 			continue;
@@ -316,7 +317,7 @@ lstcon_group_ndlink_move(lstcon_group_t *old,
 			 lstcon_group_t *new, lstcon_ndlink_t *ndl)
 {
 	unsigned int idx = LNET_NIDADDR(ndl->ndl_node->nd_id.nid) %
-			   LST_NODE_HASHSIZE;
+					LST_NODE_HASHSIZE;
 
 	list_del(&ndl->ndl_hlink);
 	list_del(&ndl->ndl_link);
@@ -918,7 +919,7 @@ lstcon_batch_list(int index, int len, char __user *name_up)
 	list_for_each_entry(bat, &console_session.ses_bat_list, bat_link) {
 		if (!index--) {
 			return copy_to_user(name_up, bat->bat_name, len) ?
-			       -EFAULT : 0;
+					    -EFAULT : 0;
 		}
 	}
 
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index 54ad6d8..b6fe1ab 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -406,7 +406,7 @@ sfw_make_session(srpc_mksn_reqst_t *request, srpc_mksn_reply_t *reply)
 {
 	sfw_session_t *sn = sfw_data.fw_session;
 	srpc_msg_t *msg = container_of(request, srpc_msg_t,
-					  msg_body.mksn_reqst);
+				       msg_body.mksn_reqst);
 	int cplen = 0;
 
 	if (request->mksn_sid.ses_nid == LNET_NID_ANY) {
@@ -1017,8 +1017,7 @@ sfw_run_batch(sfw_batch_t *tsb)
 			tsu->tsu_loop = tsi->tsi_loop;
 			wi = &tsu->tsu_worker;
 			swi_init_workitem(wi, tsu, sfw_run_test,
-					  lst_sched_test[\
-					  lnet_cpt_of_nid(tsu->tsu_dest.nid)]);
+					  lst_sched_test[lnet_cpt_of_nid(tsu->tsu_dest.nid)]);
 			swi_schedule_workitem(wi);
 		}
 	}
diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/lustre/lnet/selftest/module.c
index 1e858e9..cc046b1 100644
--- a/drivers/staging/lustre/lnet/selftest/module.c
+++ b/drivers/staging/lustre/lnet/selftest/module.c
@@ -116,8 +116,7 @@ lnet_selftest_init(void)
 		rc = cfs_wi_sched_create("lst_t", lnet_cpt_table(), i,
 					 nthrs, &lst_sched_test[i]);
 		if (rc) {
-			CERROR("Failed to create CPT affinity WI scheduler %d for LST\n",
-			       i);
+			CERROR("Failed to create CPT affinity WI scheduler %d for LST\n", i);
 			goto error;
 		}
 	}
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [lustre-devel] [PATCH 07/10] staging: lustre: cleanup comment style for lnet selftest
  2016-03-12  1:29   ` [lustre-devel] " James Simmons
@ 2016-03-12  1:39     ` Dilger, Andreas
  -1 siblings, 0 replies; 30+ messages in thread
From: Dilger, Andreas @ 2016-03-12  1:39 UTC (permalink / raw)
  To: James Simmons, Greg Kroah-Hartman, devel, Drokin, Oleg
  Cc: Linux Kernel Mailing List, Lustre Development List

On 2016/03/11, 18:29, "lustre-devel on behalf of James Simmons"
<lustre-devel-bounces@lists.lustre.org on behalf of
jsimmons@infradead.org> wrote:

>Apply a consistent style for comments in the lnet selftest
>code.
>
>Signed-off-by: James Simmons <jsimmons@infradead.org>
>---
> drivers/staging/lustre/lnet/selftest/brw_test.c  |    8 ++--
> drivers/staging/lustre/lnet/selftest/conctl.c    |   50
>+++++++++++-----------
> drivers/staging/lustre/lnet/selftest/conrpc.c    |   23 +++++-----
> drivers/staging/lustre/lnet/selftest/console.c   |   11 +++--
> drivers/staging/lustre/lnet/selftest/framework.c |   20 ++++----
> drivers/staging/lustre/lnet/selftest/ping_test.c |    2 +-
> drivers/staging/lustre/lnet/selftest/rpc.c       |   46
>++++++++++----------
> drivers/staging/lustre/lnet/selftest/rpc.h       |    2 +-
> drivers/staging/lustre/lnet/selftest/selftest.h  |    3 +-
> drivers/staging/lustre/lnet/selftest/timer.c     |    6 +-
> 10 files changed, 87 insertions(+), 84 deletions(-)
>
>diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c
>b/drivers/staging/lustre/lnet/selftest/brw_test.c
>index eebc924..6ac4d02 100644
>--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
>+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
>@@ -86,7 +86,7 @@ brw_client_init(sfw_test_instance_t *tsi)
> 		opc = breq->blk_opc;
> 		flags = breq->blk_flags;
> 		npg = breq->blk_npg;
>-		/*
>+		/**
> 		 * NB: this is not going to work for variable page size,
> 		 * but we have to keep it for compatibility
> 		 */

The "/**" comment opener is only for header comment blocks that
have markup in them.  I don't think that is kernel style for
normal multi-line comments in the code.

Cheers, Andreas

>@@ -95,7 +95,7 @@ brw_client_init(sfw_test_instance_t *tsi)
> 	} else {
> 		test_bulk_req_v1_t *breq = &tsi->tsi_u.bulk_v1;
> 
>-		/*
>+		/**
> 		 * I should never get this step if it's unknown feature
> 		 * because make_session will reject unknown feature
> 		 */
>@@ -283,7 +283,7 @@ brw_client_prep_rpc(sfw_test_unit_t *tsu,
> 	} else {
> 		test_bulk_req_v1_t *breq = &tsi->tsi_u.bulk_v1;
> 
>-		/*
>+		/**
> 		 * I should never get this step if it's unknown feature
> 		 * because make_session will reject unknown feature
> 		 */
>@@ -329,7 +329,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;
> 	}
>diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c
>b/drivers/staging/lustre/lnet/selftest/conctl.c
>index 872df72..d045ac5 100644
>--- a/drivers/staging/lustre/lnet/selftest/conctl.c
>+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
>@@ -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;
>@@ -327,7 +327,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 ||
>@@ -395,13 +395,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,
>@@ -613,18 +613,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,
>@@ -723,18 +723,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)
>diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c
>b/drivers/staging/lustre/lnet/selftest/conrpc.c
>index cdb660e..9401e1a 100644
>--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
>+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
>@@ -60,7 +60,7 @@ lstcon_rpc_done(srpc_client_rpc_t *rpc)
> 	spin_lock(&rpc->crpc_lock);
> 
> 	if (!crpc->crp_trans) {
>-		/*
>+		/**
> 		 * Orphan RPC is not in any transaction,
> 		 * I'm just a poor body and nobody loves me
> 		 */
>@@ -242,7 +242,7 @@ lstcon_rpc_trans_prep(struct list_head *translist,
> 
> 	if (translist) {
> 		list_for_each_entry(trans, translist, tas_link) {
>-			/*
>+			/**
> 			 * Can't enqueue two private transaction on
> 			 * the same object
> 			 */
>@@ -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;
>@@ -563,11 +563,11 @@ lstcon_rpc_trans_destroy(lstcon_rpc_trans_t *trans)
> 			continue;
> 		}
> 
>-		/*
>-		 * 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);
> 
>@@ -941,7 +941,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;
> 		}
>@@ -1181,7 +1181,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);
>diff --git a/drivers/staging/lustre/lnet/selftest/console.c
>b/drivers/staging/lustre/lnet/selftest/console.c
>index 6017f21..25917ac 100644
>--- a/drivers/staging/lustre/lnet/selftest/console.c
>+++ b/drivers/staging/lustre/lnet/selftest/console.c
>@@ -104,7 +104,7 @@ lstcon_node_find(lnet_process_id_t id, lstcon_node_t
>**ndpp, int create)
> 	ndl->ndl_node->nd_timeout = 0;
> 	memset(&ndl->ndl_node->nd_ping, 0, sizeof(lstcon_rpc_t));
> 
>-	/*
>+	/**
> 	 * queued in global hash & list, no refcount is taken by
> 	 * global hash & list, if caller release his refcount,
> 	 * node will be released
>@@ -276,7 +276,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;
> 	}
>@@ -608,7 +608,7 @@ lstcon_group_del(char *name)
> 	lstcon_rpc_trans_destroy(trans);
> 
> 	lstcon_group_decref(grp);
>-	/*
>+	/**
> 	 * -ref for session, it's destroyed,
> 	 * status can't be rolled back, destroy group anyway
> 	 */
>@@ -1289,7 +1289,7 @@ lstcon_test_add(char *batch_name, int type, int
>loop,
> 	lstcon_group_t *dst_grp = NULL;
> 	lstcon_batch_t *batch = NULL;
> 
>-	/*
>+	/**
> 	 * verify that a batch of the given name exists, and the groups
> 	 * that will be part of the batch exist and have at least one
> 	 * active node
>@@ -1447,7 +1447,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 */
>diff --git a/drivers/staging/lustre/lnet/selftest/framework.c
>b/drivers/staging/lustre/lnet/selftest/framework.c
>index 2ff47d2..ed2f7e9 100644
>--- a/drivers/staging/lustre/lnet/selftest/framework.c
>+++ b/drivers/staging/lustre/lnet/selftest/framework.c
>@@ -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);
>@@ -382,7 +382,7 @@ sfw_get_stats(srpc_stat_reqst_t *request,
>srpc_stat_reply_t *reply)
> 	lnet_counters_get(&reply->str_lnet);
> 	srpc_get_counters(&reply->str_rpc);
> 
>-	/*
>+	/**
> 	 * send over the msecs since the session was started
> 	 * with 32 bits to send, this is ~49 days
> 	 */
>@@ -435,7 +435,7 @@ sfw_make_session(srpc_mksn_reqst_t *request,
>srpc_mksn_reply_t *reply)
> 		}
> 	}
> 
>-	/*
>+	/**
> 	 * reject the request if it requires unknown features
> 	 * NB: old version will always accept all features because it's not
> 	 * aware of srpc_msg_t::msg_ses_feats, it's a defect but it's also
>@@ -576,7 +576,7 @@ sfw_load_test(struct sfw_test_instance *tsi)
> 	if (rc) {
> 		CWARN("Failed to reserve enough buffers: service %s, %d needed: %d\n",
> 		      svc->sv_name, nbuf, rc);
>-		/*
>+		/**
> 		 * NB: this error handler is not strictly correct, because
> 		 * it may release more buffers than already allocated,
> 		 * but it doesn't matter because request portal should
>@@ -604,7 +604,7 @@ sfw_unload_test(struct sfw_test_instance *tsi)
> 	if (tsi->tsi_is_client)
> 		return;
> 
>-	/*
>+	/**
> 	 * shrink buffers, because request portal is lazy portal
> 	 * which can grow buffers at runtime so we may leave
> 	 * some buffers behind, but never mind...
>@@ -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;
> 	}
>@@ -978,7 +978,7 @@ sfw_run_test(swi_workitem_t *wi)
> 	return 0;
> 
> test_done:
>-	/*
>+	/**
> 	 * No one can schedule me now since:
> 	 * - previous RPC, if any, has done and
> 	 * - no new RPC is initiated.
>diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c
>b/drivers/staging/lustre/lnet/selftest/ping_test.c
>index 81a4504..e05acce 100644
>--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
>+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
>@@ -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),
>diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c
>b/drivers/staging/lustre/lnet/selftest/rpc.c
>index 69be7d6..83216aa 100644
>--- a/drivers/staging/lustre/lnet/selftest/rpc.c
>+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
>@@ -276,7 +276,7 @@ srpc_service_init(struct srpc_service *svc)
> 		scd->scd_ev.ev_data = scd;
> 		scd->scd_ev.ev_type = SRPC_REQUEST_RCVD;
> 
>-		/*
>+		/**
> 		 * NB: don't use lst_sched_serial for adding buffer,
> 		 * see details in srpc_service_add_buffers()
> 		 */
>@@ -284,7 +284,7 @@ srpc_service_init(struct srpc_service *svc)
> 				  srpc_add_buffer, lst_sched_test[i]);
> 
> 		if (i && srpc_serv_is_framework(svc)) {
>-			/*
>+			/**
> 			 * NB: framework service only needs srpc_service_cd for
> 			 * one partition, but we allocate for all to make
> 			 * it easier to implement, it will waste a little
>@@ -415,7 +415,7 @@ srpc_post_active_rdma(int portal, __u64 matchbits,
>void *buf, int len,
> 		return -ENOMEM;
> 	}
> 
>-	/*
>+	/**
> 	 * this is kind of an abuse of the LNET_MD_OP_{PUT,GET} options.
> 	 * they're only meaningful for MDs attached to an ME (i.e. passive
> 	 * buffers...
>@@ -434,7 +434,7 @@ srpc_post_active_rdma(int portal, __u64 matchbits,
>void *buf, int len,
> 		       options & LNET_MD_OP_PUT ? "Put" : "Get",
> 		       libcfs_id2str(peer), portal, matchbits, rc);
> 
>-		/*
>+		/**
> 		 * The forthcoming unlink event will complete this operation
> 		 * with failure, so fall through and return success here.
> 		 */
>@@ -479,7 +479,7 @@ __must_hold(&scd->scd_lock)
> 				      msg, sizeof(*msg), &buf->buf_mdh,
> 				      &scd->scd_ev);
> 
>-	/*
>+	/**
> 	 * At this point, a RPC (new or delayed) may have arrived in
> 	 * msg and its event handler has been called. So we must add
> 	 * buf to scd_buf_posted _before_ dropping scd_lock
>@@ -491,7 +491,7 @@ __must_hold(&scd->scd_lock)
> 			return 0;
> 
> 		spin_unlock(&scd->scd_lock);
>-		/*
>+		/**
> 		 * srpc_shutdown_service might have tried to unlink me
> 		 * when my buf_mdh was still invalid
> 		 */
>@@ -520,7 +520,7 @@ srpc_add_buffer(struct swi_workitem *wi)
> 	struct srpc_buffer *buf;
> 	int rc = 0;
> 
>-	/*
>+	/**
> 	 * it's called by workitem scheduler threads, these threads
> 	 * should have been set CPT affinity, so buffers will be posted
> 	 * on CPT local list of Portal
>@@ -602,7 +602,7 @@ srpc_service_add_buffers(struct srpc_service *sv, int
>nbuffer)
> 
> 	cfs_percpt_for_each(scd, i, sv->sv_cpt_data) {
> 		spin_lock(&scd->scd_lock);
>-		/*
>+		/**
> 		 * NB: srpc_service_add_buffers() can be called inside
> 		 * thread context of lst_sched_serial, and we don't normally
> 		 * allow to sleep inside thread context of WI scheduler
>@@ -740,7 +740,7 @@ srpc_abort_service(struct srpc_service *sv)
> 	cfs_percpt_for_each(scd, i, sv->sv_cpt_data) {
> 		spin_lock(&scd->scd_lock);
> 
>-		/*
>+		/**
> 		 * schedule in-flight RPCs to notice the abort, NB:
> 		 * racing with incoming RPCs; complete fix should make test
> 		 * RPCs carry session ID in its headers
>@@ -782,7 +782,7 @@ srpc_shutdown_service(srpc_service_t *sv)
> 
> 		spin_unlock(&scd->scd_lock);
> 
>-		/*
>+		/**
> 		 * OK to traverse scd_buf_posted without lock, since no one
> 		 * touches scd_buf_posted now
> 		 */
>@@ -927,7 +927,7 @@ srpc_server_rpc_done(struct srpc_server_rpc *rpc, int
>status)
> 	spin_lock(&scd->scd_lock);
> 
> 	if (rpc->srpc_reqstbuf) {
>-		/*
>+		/**
> 		 * NB might drop sv_lock in srpc_service_recycle_buffer, but
> 		 * sv won't go away for scd_rpc_active must not be empty
> 		 */
>@@ -937,7 +937,7 @@ srpc_server_rpc_done(struct srpc_server_rpc *rpc, int
>status)
> 
> 	list_del(&rpc->srpc_list); /* from scd->scd_rpc_active */
> 
>-	/*
>+	/**
> 	 * No one can schedule me now since:
> 	 * - I'm not on scd_rpc_active.
> 	 * - all LNet events have been fired.
>@@ -1110,7 +1110,7 @@ srpc_add_client_rpc_timer(srpc_client_rpc_t *rpc)
> 	stt_add_timer(timer);
> }
> 
>-/*
>+/**
>  * Called with rpc->crpc_lock held.
>  *
>  * Upon exit the RPC expiry timer is not queued and the handler is not
>@@ -1157,7 +1157,7 @@ srpc_client_rpc_done(srpc_client_rpc_t *rpc, int
>status)
> 		     rpc->crpc_service, libcfs_id2str(rpc->crpc_dest),
> 		     swi_state2str(wi->swi_state), rpc->crpc_aborted, status);
> 
>-	/*
>+	/**
> 	 * No one can schedule me now since:
> 	 * - RPC timer has been defused.
> 	 * - all LNet events have been fired.
>@@ -1222,7 +1222,7 @@ srpc_send_rpc(swi_workitem_t *wi)
> 		break;
> 
> 	case SWI_STATE_REQUEST_SUBMITTED:
>-		/*
>+		/**
> 		 * CAVEAT EMPTOR: rqtev, rpyev, and bulkev may come in any
> 		 * order; however, they're processed in a strict order:
> 		 * rqt, rpy, and bulk.
>@@ -1273,7 +1273,7 @@ srpc_send_rpc(swi_workitem_t *wi)
> 
> 		rc = do_bulk ? rpc->crpc_bulkev.ev_status : 0;
> 
>-		/*
>+		/**
> 		 * Bulk buffer was unlinked due to remote error. Clear error
> 		 * since reply buffer still contains valid data.
> 		 * NB rpc->crpc_done shouldn't look into bulk data in case of
>@@ -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",
>@@ -1377,7 +1377,7 @@ srpc_send_reply(struct srpc_server_rpc *rpc)
> 	spin_lock(&scd->scd_lock);
> 
> 	if (!sv->sv_shuttingdown && !srpc_serv_is_framework(sv)) {
>-		/*
>+		/**
> 		 * Repost buffer before replying since test client
> 		 * might send me another RPC once it gets the reply
> 		 */
>@@ -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;
> }
> 
>@@ -1494,7 +1494,7 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
> 		scd->scd_buf_nposted--;
> 
> 		if (sv->sv_shuttingdown) {
>-			/*
>+			/**
> 			 * Leave buffer on scd->scd_buf_nposted since
> 			 * srpc_finish_service needs to traverse it.
> 			 */
>@@ -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,
>@@ -1531,7 +1531,7 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
> 			       ev->status, ev->mlength,
> 			       msg->msg_type, msg->msg_magic);
> 
>-			/*
>+			/**
> 			 * NB can't call srpc_service_recycle_buffer here since
> 			 * it may call LNetM[DE]Attach. The invalid magic tells
> 			 * srpc_handle_rpc to drop this RPC
>diff --git a/drivers/staging/lustre/lnet/selftest/rpc.h
>b/drivers/staging/lustre/lnet/selftest/rpc.h
>index a79c315..7cbf19d 100644
>--- a/drivers/staging/lustre/lnet/selftest/rpc.h
>+++ b/drivers/staging/lustre/lnet/selftest/rpc.h
>@@ -281,7 +281,7 @@ srpc_unpack_msg_hdr(srpc_msg_t *msg)
> 	if (msg->msg_magic == SRPC_MSG_MAGIC)
> 		return; /* no flipping needed */
> 
>-	/*
>+	/**
> 	 * We do not swap the magic number here as it is needed to
> 	 * determine whether the body needs to be swapped.
> 	 */
>diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h
>b/drivers/staging/lustre/lnet/selftest/selftest.h
>index 288522d..b1460f3 100644
>--- a/drivers/staging/lustre/lnet/selftest/selftest.h
>+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
>@@ -71,7 +71,8 @@ struct srpc_service_cd;
> struct sfw_test_unit;
> struct sfw_test_instance;
> 
>-/* services below SRPC_FRAMEWORK_SERVICE_MAX_ID are framework
>+/**
>+ * services below SRPC_FRAMEWORK_SERVICE_MAX_ID are framework
>  * services, e.g. create/modify session.
>  */
> #define SRPC_SERVICE_DEBUG		0
>diff --git a/drivers/staging/lustre/lnet/selftest/timer.c
>b/drivers/staging/lustre/lnet/selftest/timer.c
>index 8be5252..3e83442 100644
>--- a/drivers/staging/lustre/lnet/selftest/timer.c
>+++ b/drivers/staging/lustre/lnet/selftest/timer.c
>@@ -42,14 +42,14 @@
> 
> #include "selftest.h"
> 
>-/*
>+/**
>  * Timers are implemented as a sorted queue of expiry times. The queue
>  * is slotted, with each slot holding timers which expire in a
>  * 2**STTIMER_MINPOLL (8) second period. The timers in each slot are
>  * 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)
>@@ -92,7 +92,7 @@ stt_add_timer(struct stt_timer *timer)
> 	spin_unlock(&stt_data.stt_lock);
> }
> 
>-/*
>+/**
>  * The function returns whether it has deactivated a pending timer or
>not.
>  * (ie. del_timer() of an inactive timer returns 0, del_timer() of an
>  * active timer returns 1.)
>-- 
>1.7.1
>
>_______________________________________________
>lustre-devel mailing list
>lustre-devel@lists.lustre.org
>http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
>


Cheers, Andreas
-- 
Andreas Dilger

Lustre Principal Architect
Intel High Performance Data Division

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 07/10] staging: lustre: cleanup comment style for lnet selftest
@ 2016-03-12  1:39     ` Dilger, Andreas
  0 siblings, 0 replies; 30+ messages in thread
From: Dilger, Andreas @ 2016-03-12  1:39 UTC (permalink / raw)
  To: James Simmons, Greg Kroah-Hartman, devel, Drokin, Oleg
  Cc: Linux Kernel Mailing List, Lustre Development List

On 2016/03/11, 18:29, "lustre-devel on behalf of James Simmons"
<lustre-devel-bounces at lists.lustre.org on behalf of
jsimmons@infradead.org> wrote:

>Apply a consistent style for comments in the lnet selftest
>code.
>
>Signed-off-by: James Simmons <jsimmons@infradead.org>
>---
> drivers/staging/lustre/lnet/selftest/brw_test.c  |    8 ++--
> drivers/staging/lustre/lnet/selftest/conctl.c    |   50
>+++++++++++-----------
> drivers/staging/lustre/lnet/selftest/conrpc.c    |   23 +++++-----
> drivers/staging/lustre/lnet/selftest/console.c   |   11 +++--
> drivers/staging/lustre/lnet/selftest/framework.c |   20 ++++----
> drivers/staging/lustre/lnet/selftest/ping_test.c |    2 +-
> drivers/staging/lustre/lnet/selftest/rpc.c       |   46
>++++++++++----------
> drivers/staging/lustre/lnet/selftest/rpc.h       |    2 +-
> drivers/staging/lustre/lnet/selftest/selftest.h  |    3 +-
> drivers/staging/lustre/lnet/selftest/timer.c     |    6 +-
> 10 files changed, 87 insertions(+), 84 deletions(-)
>
>diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c
>b/drivers/staging/lustre/lnet/selftest/brw_test.c
>index eebc924..6ac4d02 100644
>--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
>+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
>@@ -86,7 +86,7 @@ brw_client_init(sfw_test_instance_t *tsi)
> 		opc = breq->blk_opc;
> 		flags = breq->blk_flags;
> 		npg = breq->blk_npg;
>-		/*
>+		/**
> 		 * NB: this is not going to work for variable page size,
> 		 * but we have to keep it for compatibility
> 		 */

The "/**" comment opener is only for header comment blocks that
have markup in them.  I don't think that is kernel style for
normal multi-line comments in the code.

Cheers, Andreas

>@@ -95,7 +95,7 @@ brw_client_init(sfw_test_instance_t *tsi)
> 	} else {
> 		test_bulk_req_v1_t *breq = &tsi->tsi_u.bulk_v1;
> 
>-		/*
>+		/**
> 		 * I should never get this step if it's unknown feature
> 		 * because make_session will reject unknown feature
> 		 */
>@@ -283,7 +283,7 @@ brw_client_prep_rpc(sfw_test_unit_t *tsu,
> 	} else {
> 		test_bulk_req_v1_t *breq = &tsi->tsi_u.bulk_v1;
> 
>-		/*
>+		/**
> 		 * I should never get this step if it's unknown feature
> 		 * because make_session will reject unknown feature
> 		 */
>@@ -329,7 +329,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;
> 	}
>diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c
>b/drivers/staging/lustre/lnet/selftest/conctl.c
>index 872df72..d045ac5 100644
>--- a/drivers/staging/lustre/lnet/selftest/conctl.c
>+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
>@@ -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;
>@@ -327,7 +327,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 ||
>@@ -395,13 +395,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,
>@@ -613,18 +613,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,
>@@ -723,18 +723,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)
>diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c
>b/drivers/staging/lustre/lnet/selftest/conrpc.c
>index cdb660e..9401e1a 100644
>--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
>+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
>@@ -60,7 +60,7 @@ lstcon_rpc_done(srpc_client_rpc_t *rpc)
> 	spin_lock(&rpc->crpc_lock);
> 
> 	if (!crpc->crp_trans) {
>-		/*
>+		/**
> 		 * Orphan RPC is not in any transaction,
> 		 * I'm just a poor body and nobody loves me
> 		 */
>@@ -242,7 +242,7 @@ lstcon_rpc_trans_prep(struct list_head *translist,
> 
> 	if (translist) {
> 		list_for_each_entry(trans, translist, tas_link) {
>-			/*
>+			/**
> 			 * Can't enqueue two private transaction on
> 			 * the same object
> 			 */
>@@ -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;
>@@ -563,11 +563,11 @@ lstcon_rpc_trans_destroy(lstcon_rpc_trans_t *trans)
> 			continue;
> 		}
> 
>-		/*
>-		 * 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);
> 
>@@ -941,7 +941,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;
> 		}
>@@ -1181,7 +1181,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);
>diff --git a/drivers/staging/lustre/lnet/selftest/console.c
>b/drivers/staging/lustre/lnet/selftest/console.c
>index 6017f21..25917ac 100644
>--- a/drivers/staging/lustre/lnet/selftest/console.c
>+++ b/drivers/staging/lustre/lnet/selftest/console.c
>@@ -104,7 +104,7 @@ lstcon_node_find(lnet_process_id_t id, lstcon_node_t
>**ndpp, int create)
> 	ndl->ndl_node->nd_timeout = 0;
> 	memset(&ndl->ndl_node->nd_ping, 0, sizeof(lstcon_rpc_t));
> 
>-	/*
>+	/**
> 	 * queued in global hash & list, no refcount is taken by
> 	 * global hash & list, if caller release his refcount,
> 	 * node will be released
>@@ -276,7 +276,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;
> 	}
>@@ -608,7 +608,7 @@ lstcon_group_del(char *name)
> 	lstcon_rpc_trans_destroy(trans);
> 
> 	lstcon_group_decref(grp);
>-	/*
>+	/**
> 	 * -ref for session, it's destroyed,
> 	 * status can't be rolled back, destroy group anyway
> 	 */
>@@ -1289,7 +1289,7 @@ lstcon_test_add(char *batch_name, int type, int
>loop,
> 	lstcon_group_t *dst_grp = NULL;
> 	lstcon_batch_t *batch = NULL;
> 
>-	/*
>+	/**
> 	 * verify that a batch of the given name exists, and the groups
> 	 * that will be part of the batch exist and have at least one
> 	 * active node
>@@ -1447,7 +1447,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 */
>diff --git a/drivers/staging/lustre/lnet/selftest/framework.c
>b/drivers/staging/lustre/lnet/selftest/framework.c
>index 2ff47d2..ed2f7e9 100644
>--- a/drivers/staging/lustre/lnet/selftest/framework.c
>+++ b/drivers/staging/lustre/lnet/selftest/framework.c
>@@ -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);
>@@ -382,7 +382,7 @@ sfw_get_stats(srpc_stat_reqst_t *request,
>srpc_stat_reply_t *reply)
> 	lnet_counters_get(&reply->str_lnet);
> 	srpc_get_counters(&reply->str_rpc);
> 
>-	/*
>+	/**
> 	 * send over the msecs since the session was started
> 	 * with 32 bits to send, this is ~49 days
> 	 */
>@@ -435,7 +435,7 @@ sfw_make_session(srpc_mksn_reqst_t *request,
>srpc_mksn_reply_t *reply)
> 		}
> 	}
> 
>-	/*
>+	/**
> 	 * reject the request if it requires unknown features
> 	 * NB: old version will always accept all features because it's not
> 	 * aware of srpc_msg_t::msg_ses_feats, it's a defect but it's also
>@@ -576,7 +576,7 @@ sfw_load_test(struct sfw_test_instance *tsi)
> 	if (rc) {
> 		CWARN("Failed to reserve enough buffers: service %s, %d needed: %d\n",
> 		      svc->sv_name, nbuf, rc);
>-		/*
>+		/**
> 		 * NB: this error handler is not strictly correct, because
> 		 * it may release more buffers than already allocated,
> 		 * but it doesn't matter because request portal should
>@@ -604,7 +604,7 @@ sfw_unload_test(struct sfw_test_instance *tsi)
> 	if (tsi->tsi_is_client)
> 		return;
> 
>-	/*
>+	/**
> 	 * shrink buffers, because request portal is lazy portal
> 	 * which can grow buffers at runtime so we may leave
> 	 * some buffers behind, but never mind...
>@@ -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;
> 	}
>@@ -978,7 +978,7 @@ sfw_run_test(swi_workitem_t *wi)
> 	return 0;
> 
> test_done:
>-	/*
>+	/**
> 	 * No one can schedule me now since:
> 	 * - previous RPC, if any, has done and
> 	 * - no new RPC is initiated.
>diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c
>b/drivers/staging/lustre/lnet/selftest/ping_test.c
>index 81a4504..e05acce 100644
>--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
>+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
>@@ -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),
>diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c
>b/drivers/staging/lustre/lnet/selftest/rpc.c
>index 69be7d6..83216aa 100644
>--- a/drivers/staging/lustre/lnet/selftest/rpc.c
>+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
>@@ -276,7 +276,7 @@ srpc_service_init(struct srpc_service *svc)
> 		scd->scd_ev.ev_data = scd;
> 		scd->scd_ev.ev_type = SRPC_REQUEST_RCVD;
> 
>-		/*
>+		/**
> 		 * NB: don't use lst_sched_serial for adding buffer,
> 		 * see details in srpc_service_add_buffers()
> 		 */
>@@ -284,7 +284,7 @@ srpc_service_init(struct srpc_service *svc)
> 				  srpc_add_buffer, lst_sched_test[i]);
> 
> 		if (i && srpc_serv_is_framework(svc)) {
>-			/*
>+			/**
> 			 * NB: framework service only needs srpc_service_cd for
> 			 * one partition, but we allocate for all to make
> 			 * it easier to implement, it will waste a little
>@@ -415,7 +415,7 @@ srpc_post_active_rdma(int portal, __u64 matchbits,
>void *buf, int len,
> 		return -ENOMEM;
> 	}
> 
>-	/*
>+	/**
> 	 * this is kind of an abuse of the LNET_MD_OP_{PUT,GET} options.
> 	 * they're only meaningful for MDs attached to an ME (i.e. passive
> 	 * buffers...
>@@ -434,7 +434,7 @@ srpc_post_active_rdma(int portal, __u64 matchbits,
>void *buf, int len,
> 		       options & LNET_MD_OP_PUT ? "Put" : "Get",
> 		       libcfs_id2str(peer), portal, matchbits, rc);
> 
>-		/*
>+		/**
> 		 * The forthcoming unlink event will complete this operation
> 		 * with failure, so fall through and return success here.
> 		 */
>@@ -479,7 +479,7 @@ __must_hold(&scd->scd_lock)
> 				      msg, sizeof(*msg), &buf->buf_mdh,
> 				      &scd->scd_ev);
> 
>-	/*
>+	/**
> 	 * At this point, a RPC (new or delayed) may have arrived in
> 	 * msg and its event handler has been called. So we must add
> 	 * buf to scd_buf_posted _before_ dropping scd_lock
>@@ -491,7 +491,7 @@ __must_hold(&scd->scd_lock)
> 			return 0;
> 
> 		spin_unlock(&scd->scd_lock);
>-		/*
>+		/**
> 		 * srpc_shutdown_service might have tried to unlink me
> 		 * when my buf_mdh was still invalid
> 		 */
>@@ -520,7 +520,7 @@ srpc_add_buffer(struct swi_workitem *wi)
> 	struct srpc_buffer *buf;
> 	int rc = 0;
> 
>-	/*
>+	/**
> 	 * it's called by workitem scheduler threads, these threads
> 	 * should have been set CPT affinity, so buffers will be posted
> 	 * on CPT local list of Portal
>@@ -602,7 +602,7 @@ srpc_service_add_buffers(struct srpc_service *sv, int
>nbuffer)
> 
> 	cfs_percpt_for_each(scd, i, sv->sv_cpt_data) {
> 		spin_lock(&scd->scd_lock);
>-		/*
>+		/**
> 		 * NB: srpc_service_add_buffers() can be called inside
> 		 * thread context of lst_sched_serial, and we don't normally
> 		 * allow to sleep inside thread context of WI scheduler
>@@ -740,7 +740,7 @@ srpc_abort_service(struct srpc_service *sv)
> 	cfs_percpt_for_each(scd, i, sv->sv_cpt_data) {
> 		spin_lock(&scd->scd_lock);
> 
>-		/*
>+		/**
> 		 * schedule in-flight RPCs to notice the abort, NB:
> 		 * racing with incoming RPCs; complete fix should make test
> 		 * RPCs carry session ID in its headers
>@@ -782,7 +782,7 @@ srpc_shutdown_service(srpc_service_t *sv)
> 
> 		spin_unlock(&scd->scd_lock);
> 
>-		/*
>+		/**
> 		 * OK to traverse scd_buf_posted without lock, since no one
> 		 * touches scd_buf_posted now
> 		 */
>@@ -927,7 +927,7 @@ srpc_server_rpc_done(struct srpc_server_rpc *rpc, int
>status)
> 	spin_lock(&scd->scd_lock);
> 
> 	if (rpc->srpc_reqstbuf) {
>-		/*
>+		/**
> 		 * NB might drop sv_lock in srpc_service_recycle_buffer, but
> 		 * sv won't go away for scd_rpc_active must not be empty
> 		 */
>@@ -937,7 +937,7 @@ srpc_server_rpc_done(struct srpc_server_rpc *rpc, int
>status)
> 
> 	list_del(&rpc->srpc_list); /* from scd->scd_rpc_active */
> 
>-	/*
>+	/**
> 	 * No one can schedule me now since:
> 	 * - I'm not on scd_rpc_active.
> 	 * - all LNet events have been fired.
>@@ -1110,7 +1110,7 @@ srpc_add_client_rpc_timer(srpc_client_rpc_t *rpc)
> 	stt_add_timer(timer);
> }
> 
>-/*
>+/**
>  * Called with rpc->crpc_lock held.
>  *
>  * Upon exit the RPC expiry timer is not queued and the handler is not
>@@ -1157,7 +1157,7 @@ srpc_client_rpc_done(srpc_client_rpc_t *rpc, int
>status)
> 		     rpc->crpc_service, libcfs_id2str(rpc->crpc_dest),
> 		     swi_state2str(wi->swi_state), rpc->crpc_aborted, status);
> 
>-	/*
>+	/**
> 	 * No one can schedule me now since:
> 	 * - RPC timer has been defused.
> 	 * - all LNet events have been fired.
>@@ -1222,7 +1222,7 @@ srpc_send_rpc(swi_workitem_t *wi)
> 		break;
> 
> 	case SWI_STATE_REQUEST_SUBMITTED:
>-		/*
>+		/**
> 		 * CAVEAT EMPTOR: rqtev, rpyev, and bulkev may come in any
> 		 * order; however, they're processed in a strict order:
> 		 * rqt, rpy, and bulk.
>@@ -1273,7 +1273,7 @@ srpc_send_rpc(swi_workitem_t *wi)
> 
> 		rc = do_bulk ? rpc->crpc_bulkev.ev_status : 0;
> 
>-		/*
>+		/**
> 		 * Bulk buffer was unlinked due to remote error. Clear error
> 		 * since reply buffer still contains valid data.
> 		 * NB rpc->crpc_done shouldn't look into bulk data in case of
>@@ -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",
>@@ -1377,7 +1377,7 @@ srpc_send_reply(struct srpc_server_rpc *rpc)
> 	spin_lock(&scd->scd_lock);
> 
> 	if (!sv->sv_shuttingdown && !srpc_serv_is_framework(sv)) {
>-		/*
>+		/**
> 		 * Repost buffer before replying since test client
> 		 * might send me another RPC once it gets the reply
> 		 */
>@@ -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;
> }
> 
>@@ -1494,7 +1494,7 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
> 		scd->scd_buf_nposted--;
> 
> 		if (sv->sv_shuttingdown) {
>-			/*
>+			/**
> 			 * Leave buffer on scd->scd_buf_nposted since
> 			 * srpc_finish_service needs to traverse it.
> 			 */
>@@ -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,
>@@ -1531,7 +1531,7 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
> 			       ev->status, ev->mlength,
> 			       msg->msg_type, msg->msg_magic);
> 
>-			/*
>+			/**
> 			 * NB can't call srpc_service_recycle_buffer here since
> 			 * it may call LNetM[DE]Attach. The invalid magic tells
> 			 * srpc_handle_rpc to drop this RPC
>diff --git a/drivers/staging/lustre/lnet/selftest/rpc.h
>b/drivers/staging/lustre/lnet/selftest/rpc.h
>index a79c315..7cbf19d 100644
>--- a/drivers/staging/lustre/lnet/selftest/rpc.h
>+++ b/drivers/staging/lustre/lnet/selftest/rpc.h
>@@ -281,7 +281,7 @@ srpc_unpack_msg_hdr(srpc_msg_t *msg)
> 	if (msg->msg_magic == SRPC_MSG_MAGIC)
> 		return; /* no flipping needed */
> 
>-	/*
>+	/**
> 	 * We do not swap the magic number here as it is needed to
> 	 * determine whether the body needs to be swapped.
> 	 */
>diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h
>b/drivers/staging/lustre/lnet/selftest/selftest.h
>index 288522d..b1460f3 100644
>--- a/drivers/staging/lustre/lnet/selftest/selftest.h
>+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
>@@ -71,7 +71,8 @@ struct srpc_service_cd;
> struct sfw_test_unit;
> struct sfw_test_instance;
> 
>-/* services below SRPC_FRAMEWORK_SERVICE_MAX_ID are framework
>+/**
>+ * services below SRPC_FRAMEWORK_SERVICE_MAX_ID are framework
>  * services, e.g. create/modify session.
>  */
> #define SRPC_SERVICE_DEBUG		0
>diff --git a/drivers/staging/lustre/lnet/selftest/timer.c
>b/drivers/staging/lustre/lnet/selftest/timer.c
>index 8be5252..3e83442 100644
>--- a/drivers/staging/lustre/lnet/selftest/timer.c
>+++ b/drivers/staging/lustre/lnet/selftest/timer.c
>@@ -42,14 +42,14 @@
> 
> #include "selftest.h"
> 
>-/*
>+/**
>  * Timers are implemented as a sorted queue of expiry times. The queue
>  * is slotted, with each slot holding timers which expire in a
>  * 2**STTIMER_MINPOLL (8) second period. The timers in each slot are
>  * 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)
>@@ -92,7 +92,7 @@ stt_add_timer(struct stt_timer *timer)
> 	spin_unlock(&stt_data.stt_lock);
> }
> 
>-/*
>+/**
>  * The function returns whether it has deactivated a pending timer or
>not.
>  * (ie. del_timer() of an inactive timer returns 0, del_timer() of an
>  * active timer returns 1.)
>-- 
>1.7.1
>
>_______________________________________________
>lustre-devel mailing list
>lustre-devel at lists.lustre.org
>http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
>


Cheers, Andreas
-- 
Andreas Dilger

Lustre Principal Architect
Intel High Performance Data Division

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [lustre-devel] [PATCH 07/10] staging: lustre: cleanup comment style for lnet selftest
  2016-03-12  1:39     ` Dilger, Andreas
@ 2016-03-12  6:24       ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-03-12  6:24 UTC (permalink / raw)
  To: Dilger, Andreas
  Cc: James Simmons, devel, Drokin, Oleg, Linux Kernel Mailing List,
	Lustre Development List

On Sat, Mar 12, 2016 at 01:39:01AM +0000, Dilger, Andreas wrote:
> On 2016/03/11, 18:29, "lustre-devel on behalf of James Simmons"
> <lustre-devel-bounces@lists.lustre.org on behalf of
> jsimmons@infradead.org> wrote:
> 
> >Apply a consistent style for comments in the lnet selftest
> >code.
> >
> >Signed-off-by: James Simmons <jsimmons@infradead.org>
> >---
> > drivers/staging/lustre/lnet/selftest/brw_test.c  |    8 ++--
> > drivers/staging/lustre/lnet/selftest/conctl.c    |   50
> >+++++++++++-----------
> > drivers/staging/lustre/lnet/selftest/conrpc.c    |   23 +++++-----
> > drivers/staging/lustre/lnet/selftest/console.c   |   11 +++--
> > drivers/staging/lustre/lnet/selftest/framework.c |   20 ++++----
> > drivers/staging/lustre/lnet/selftest/ping_test.c |    2 +-
> > drivers/staging/lustre/lnet/selftest/rpc.c       |   46
> >++++++++++----------
> > drivers/staging/lustre/lnet/selftest/rpc.h       |    2 +-
> > drivers/staging/lustre/lnet/selftest/selftest.h  |    3 +-
> > drivers/staging/lustre/lnet/selftest/timer.c     |    6 +-
> > 10 files changed, 87 insertions(+), 84 deletions(-)
> >
> >diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c
> >b/drivers/staging/lustre/lnet/selftest/brw_test.c
> >index eebc924..6ac4d02 100644
> >--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
> >+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
> >@@ -86,7 +86,7 @@ brw_client_init(sfw_test_instance_t *tsi)
> > 		opc = breq->blk_opc;
> > 		flags = breq->blk_flags;
> > 		npg = breq->blk_npg;
> >-		/*
> >+		/**
> > 		 * NB: this is not going to work for variable page size,
> > 		 * but we have to keep it for compatibility
> > 		 */
> 
> The "/**" comment opener is only for header comment blocks that
> have markup in them.  I don't think that is kernel style for
> normal multi-line comments in the code.

Yes, that is correct.  James, can you fix this up and resend this
series?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 07/10] staging: lustre: cleanup comment style for lnet selftest
@ 2016-03-12  6:24       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-03-12  6:24 UTC (permalink / raw)
  To: Dilger, Andreas
  Cc: James Simmons, devel, Drokin, Oleg, Linux Kernel Mailing List,
	Lustre Development List

On Sat, Mar 12, 2016 at 01:39:01AM +0000, Dilger, Andreas wrote:
> On 2016/03/11, 18:29, "lustre-devel on behalf of James Simmons"
> <lustre-devel-bounces@lists.lustre.org on behalf of
> jsimmons at infradead.org> wrote:
> 
> >Apply a consistent style for comments in the lnet selftest
> >code.
> >
> >Signed-off-by: James Simmons <jsimmons@infradead.org>
> >---
> > drivers/staging/lustre/lnet/selftest/brw_test.c  |    8 ++--
> > drivers/staging/lustre/lnet/selftest/conctl.c    |   50
> >+++++++++++-----------
> > drivers/staging/lustre/lnet/selftest/conrpc.c    |   23 +++++-----
> > drivers/staging/lustre/lnet/selftest/console.c   |   11 +++--
> > drivers/staging/lustre/lnet/selftest/framework.c |   20 ++++----
> > drivers/staging/lustre/lnet/selftest/ping_test.c |    2 +-
> > drivers/staging/lustre/lnet/selftest/rpc.c       |   46
> >++++++++++----------
> > drivers/staging/lustre/lnet/selftest/rpc.h       |    2 +-
> > drivers/staging/lustre/lnet/selftest/selftest.h  |    3 +-
> > drivers/staging/lustre/lnet/selftest/timer.c     |    6 +-
> > 10 files changed, 87 insertions(+), 84 deletions(-)
> >
> >diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c
> >b/drivers/staging/lustre/lnet/selftest/brw_test.c
> >index eebc924..6ac4d02 100644
> >--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
> >+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
> >@@ -86,7 +86,7 @@ brw_client_init(sfw_test_instance_t *tsi)
> > 		opc = breq->blk_opc;
> > 		flags = breq->blk_flags;
> > 		npg = breq->blk_npg;
> >-		/*
> >+		/**
> > 		 * NB: this is not going to work for variable page size,
> > 		 * but we have to keep it for compatibility
> > 		 */
> 
> The "/**" comment opener is only for header comment blocks that
> have markup in them.  I don't think that is kernel style for
> normal multi-line comments in the code.

Yes, that is correct.  James, can you fix this up and resend this
series?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [lustre-devel] [PATCH 07/10] staging: lustre: cleanup comment style for lnet selftest
  2016-03-12  6:24       ` Greg Kroah-Hartman
@ 2016-03-12  6:25         ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-03-12  6:25 UTC (permalink / raw)
  To: Dilger, Andreas
  Cc: James Simmons, devel, Drokin, Oleg, Linux Kernel Mailing List,
	Lustre Development List

On Fri, Mar 11, 2016 at 10:24:00PM -0800, Greg Kroah-Hartman wrote:
> On Sat, Mar 12, 2016 at 01:39:01AM +0000, Dilger, Andreas wrote:
> > On 2016/03/11, 18:29, "lustre-devel on behalf of James Simmons"
> > <lustre-devel-bounces@lists.lustre.org on behalf of
> > jsimmons@infradead.org> wrote:
> > 
> > >Apply a consistent style for comments in the lnet selftest
> > >code.
> > >
> > >Signed-off-by: James Simmons <jsimmons@infradead.org>
> > >---
> > > drivers/staging/lustre/lnet/selftest/brw_test.c  |    8 ++--
> > > drivers/staging/lustre/lnet/selftest/conctl.c    |   50
> > >+++++++++++-----------
> > > drivers/staging/lustre/lnet/selftest/conrpc.c    |   23 +++++-----
> > > drivers/staging/lustre/lnet/selftest/console.c   |   11 +++--
> > > drivers/staging/lustre/lnet/selftest/framework.c |   20 ++++----
> > > drivers/staging/lustre/lnet/selftest/ping_test.c |    2 +-
> > > drivers/staging/lustre/lnet/selftest/rpc.c       |   46
> > >++++++++++----------
> > > drivers/staging/lustre/lnet/selftest/rpc.h       |    2 +-
> > > drivers/staging/lustre/lnet/selftest/selftest.h  |    3 +-
> > > drivers/staging/lustre/lnet/selftest/timer.c     |    6 +-
> > > 10 files changed, 87 insertions(+), 84 deletions(-)
> > >
> > >diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c
> > >b/drivers/staging/lustre/lnet/selftest/brw_test.c
> > >index eebc924..6ac4d02 100644
> > >--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
> > >+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
> > >@@ -86,7 +86,7 @@ brw_client_init(sfw_test_instance_t *tsi)
> > > 		opc = breq->blk_opc;
> > > 		flags = breq->blk_flags;
> > > 		npg = breq->blk_npg;
> > >-		/*
> > >+		/**
> > > 		 * NB: this is not going to work for variable page size,
> > > 		 * but we have to keep it for compatibility
> > > 		 */
> > 
> > The "/**" comment opener is only for header comment blocks that
> > have markup in them.  I don't think that is kernel style for
> > normal multi-line comments in the code.
> 
> Yes, that is correct.  James, can you fix this up and resend this
> series?

Sorry, I meant the series from this patch onward.  I've applied the
first 6.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 07/10] staging: lustre: cleanup comment style for lnet selftest
@ 2016-03-12  6:25         ` Greg Kroah-Hartman
  0 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-03-12  6:25 UTC (permalink / raw)
  To: Dilger, Andreas
  Cc: James Simmons, devel, Drokin, Oleg, Linux Kernel Mailing List,
	Lustre Development List

On Fri, Mar 11, 2016 at 10:24:00PM -0800, Greg Kroah-Hartman wrote:
> On Sat, Mar 12, 2016 at 01:39:01AM +0000, Dilger, Andreas wrote:
> > On 2016/03/11, 18:29, "lustre-devel on behalf of James Simmons"
> > <lustre-devel-bounces@lists.lustre.org on behalf of
> > jsimmons at infradead.org> wrote:
> > 
> > >Apply a consistent style for comments in the lnet selftest
> > >code.
> > >
> > >Signed-off-by: James Simmons <jsimmons@infradead.org>
> > >---
> > > drivers/staging/lustre/lnet/selftest/brw_test.c  |    8 ++--
> > > drivers/staging/lustre/lnet/selftest/conctl.c    |   50
> > >+++++++++++-----------
> > > drivers/staging/lustre/lnet/selftest/conrpc.c    |   23 +++++-----
> > > drivers/staging/lustre/lnet/selftest/console.c   |   11 +++--
> > > drivers/staging/lustre/lnet/selftest/framework.c |   20 ++++----
> > > drivers/staging/lustre/lnet/selftest/ping_test.c |    2 +-
> > > drivers/staging/lustre/lnet/selftest/rpc.c       |   46
> > >++++++++++----------
> > > drivers/staging/lustre/lnet/selftest/rpc.h       |    2 +-
> > > drivers/staging/lustre/lnet/selftest/selftest.h  |    3 +-
> > > drivers/staging/lustre/lnet/selftest/timer.c     |    6 +-
> > > 10 files changed, 87 insertions(+), 84 deletions(-)
> > >
> > >diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c
> > >b/drivers/staging/lustre/lnet/selftest/brw_test.c
> > >index eebc924..6ac4d02 100644
> > >--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
> > >+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
> > >@@ -86,7 +86,7 @@ brw_client_init(sfw_test_instance_t *tsi)
> > > 		opc = breq->blk_opc;
> > > 		flags = breq->blk_flags;
> > > 		npg = breq->blk_npg;
> > >-		/*
> > >+		/**
> > > 		 * NB: this is not going to work for variable page size,
> > > 		 * but we have to keep it for compatibility
> > > 		 */
> > 
> > The "/**" comment opener is only for header comment blocks that
> > have markup in them.  I don't think that is kernel style for
> > normal multi-line comments in the code.
> 
> Yes, that is correct.  James, can you fix this up and resend this
> series?

Sorry, I meant the series from this patch onward.  I've applied the
first 6.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [lustre-devel] [PATCH 07/10] staging: lustre: cleanup comment style for lnet selftest
  2016-03-12  6:25         ` Greg Kroah-Hartman
@ 2016-03-12  6:26           ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-03-12  6:26 UTC (permalink / raw)
  To: Dilger, Andreas
  Cc: James Simmons, devel, Drokin, Oleg, Linux Kernel Mailing List,
	Lustre Development List

On Fri, Mar 11, 2016 at 10:25:32PM -0800, Greg Kroah-Hartman wrote:
> On Fri, Mar 11, 2016 at 10:24:00PM -0800, Greg Kroah-Hartman wrote:
> > On Sat, Mar 12, 2016 at 01:39:01AM +0000, Dilger, Andreas wrote:
> > > On 2016/03/11, 18:29, "lustre-devel on behalf of James Simmons"
> > > <lustre-devel-bounces@lists.lustre.org on behalf of
> > > jsimmons@infradead.org> wrote:
> > > 
> > > >Apply a consistent style for comments in the lnet selftest
> > > >code.
> > > >
> > > >Signed-off-by: James Simmons <jsimmons@infradead.org>
> > > >---
> > > > drivers/staging/lustre/lnet/selftest/brw_test.c  |    8 ++--
> > > > drivers/staging/lustre/lnet/selftest/conctl.c    |   50
> > > >+++++++++++-----------
> > > > drivers/staging/lustre/lnet/selftest/conrpc.c    |   23 +++++-----
> > > > drivers/staging/lustre/lnet/selftest/console.c   |   11 +++--
> > > > drivers/staging/lustre/lnet/selftest/framework.c |   20 ++++----
> > > > drivers/staging/lustre/lnet/selftest/ping_test.c |    2 +-
> > > > drivers/staging/lustre/lnet/selftest/rpc.c       |   46
> > > >++++++++++----------
> > > > drivers/staging/lustre/lnet/selftest/rpc.h       |    2 +-
> > > > drivers/staging/lustre/lnet/selftest/selftest.h  |    3 +-
> > > > drivers/staging/lustre/lnet/selftest/timer.c     |    6 +-
> > > > 10 files changed, 87 insertions(+), 84 deletions(-)
> > > >
> > > >diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c
> > > >b/drivers/staging/lustre/lnet/selftest/brw_test.c
> > > >index eebc924..6ac4d02 100644
> > > >--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
> > > >+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
> > > >@@ -86,7 +86,7 @@ brw_client_init(sfw_test_instance_t *tsi)
> > > > 		opc = breq->blk_opc;
> > > > 		flags = breq->blk_flags;
> > > > 		npg = breq->blk_npg;
> > > >-		/*
> > > >+		/**
> > > > 		 * NB: this is not going to work for variable page size,
> > > > 		 * but we have to keep it for compatibility
> > > > 		 */
> > > 
> > > The "/**" comment opener is only for header comment blocks that
> > > have markup in them.  I don't think that is kernel style for
> > > normal multi-line comments in the code.
> > 
> > Yes, that is correct.  James, can you fix this up and resend this
> > series?
> 
> Sorry, I meant the series from this patch onward.  I've applied the
> first 6.

Make that just this patch, the ones after this applied just fine.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 07/10] staging: lustre: cleanup comment style for lnet selftest
@ 2016-03-12  6:26           ` Greg Kroah-Hartman
  0 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-03-12  6:26 UTC (permalink / raw)
  To: Dilger, Andreas
  Cc: James Simmons, devel, Drokin, Oleg, Linux Kernel Mailing List,
	Lustre Development List

On Fri, Mar 11, 2016 at 10:25:32PM -0800, Greg Kroah-Hartman wrote:
> On Fri, Mar 11, 2016 at 10:24:00PM -0800, Greg Kroah-Hartman wrote:
> > On Sat, Mar 12, 2016 at 01:39:01AM +0000, Dilger, Andreas wrote:
> > > On 2016/03/11, 18:29, "lustre-devel on behalf of James Simmons"
> > > <lustre-devel-bounces@lists.lustre.org on behalf of
> > > jsimmons at infradead.org> wrote:
> > > 
> > > >Apply a consistent style for comments in the lnet selftest
> > > >code.
> > > >
> > > >Signed-off-by: James Simmons <jsimmons@infradead.org>
> > > >---
> > > > drivers/staging/lustre/lnet/selftest/brw_test.c  |    8 ++--
> > > > drivers/staging/lustre/lnet/selftest/conctl.c    |   50
> > > >+++++++++++-----------
> > > > drivers/staging/lustre/lnet/selftest/conrpc.c    |   23 +++++-----
> > > > drivers/staging/lustre/lnet/selftest/console.c   |   11 +++--
> > > > drivers/staging/lustre/lnet/selftest/framework.c |   20 ++++----
> > > > drivers/staging/lustre/lnet/selftest/ping_test.c |    2 +-
> > > > drivers/staging/lustre/lnet/selftest/rpc.c       |   46
> > > >++++++++++----------
> > > > drivers/staging/lustre/lnet/selftest/rpc.h       |    2 +-
> > > > drivers/staging/lustre/lnet/selftest/selftest.h  |    3 +-
> > > > drivers/staging/lustre/lnet/selftest/timer.c     |    6 +-
> > > > 10 files changed, 87 insertions(+), 84 deletions(-)
> > > >
> > > >diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c
> > > >b/drivers/staging/lustre/lnet/selftest/brw_test.c
> > > >index eebc924..6ac4d02 100644
> > > >--- a/drivers/staging/lustre/lnet/selftest/brw_test.c
> > > >+++ b/drivers/staging/lustre/lnet/selftest/brw_test.c
> > > >@@ -86,7 +86,7 @@ brw_client_init(sfw_test_instance_t *tsi)
> > > > 		opc = breq->blk_opc;
> > > > 		flags = breq->blk_flags;
> > > > 		npg = breq->blk_npg;
> > > >-		/*
> > > >+		/**
> > > > 		 * NB: this is not going to work for variable page size,
> > > > 		 * but we have to keep it for compatibility
> > > > 		 */
> > > 
> > > The "/**" comment opener is only for header comment blocks that
> > > have markup in them.  I don't think that is kernel style for
> > > normal multi-line comments in the code.
> > 
> > Yes, that is correct.  James, can you fix this up and resend this
> > series?
> 
> Sorry, I meant the series from this patch onward.  I've applied the
> first 6.

Make that just this patch, the ones after this applied just fine.

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2016-03-12  6:27 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-12  1:29 [PATCH 00/10] Cleanup and audit of lnet selftest code James Simmons
2016-03-12  1:29 ` [lustre-devel] " James Simmons
2016-03-12  1:29 ` [PATCH 01/10] staging: lustre: fix bogus lst errors for lnet selftest James Simmons
2016-03-12  1:29   ` [lustre-devel] " James Simmons
2016-03-12  1:29 ` [PATCH 02/10] staging: lustre: remove returns in void function " James Simmons
2016-03-12  1:29   ` [lustre-devel] " James Simmons
2016-03-12  1:29 ` [PATCH 03/10] staging: lustre: fix spacing issues checkpatch reported in " James Simmons
2016-03-12  1:29   ` [lustre-devel] " James Simmons
2016-03-12  1:29 ` [PATCH 04/10] staging: lustre: remove extra spacing of variable declartions for " James Simmons
2016-03-12  1:29   ` [lustre-devel] " James Simmons
2016-03-12  1:29 ` [PATCH 05/10] staging: lustre: remove extra spacing when setting variable " James Simmons
2016-03-12  1:29   ` [lustre-devel] " James Simmons
2016-03-12  1:29 ` [PATCH 06/10] staging: lustre: filter remaining extra spacing " James Simmons
2016-03-12  1:29   ` [lustre-devel] " James Simmons
2016-03-12  1:29 ` [PATCH 07/10] staging: lustre: cleanup comment style " James Simmons
2016-03-12  1:29   ` [lustre-devel] " James Simmons
2016-03-12  1:39   ` Dilger, Andreas
2016-03-12  1:39     ` Dilger, Andreas
2016-03-12  6:24     ` Greg Kroah-Hartman
2016-03-12  6:24       ` Greg Kroah-Hartman
2016-03-12  6:25       ` Greg Kroah-Hartman
2016-03-12  6:25         ` Greg Kroah-Hartman
2016-03-12  6:26         ` Greg Kroah-Hartman
2016-03-12  6:26           ` Greg Kroah-Hartman
2016-03-12  1:29 ` [PATCH 08/10] staging: lustre: test for proper errno code in lstcon_rpc_trans_abort James Simmons
2016-03-12  1:29   ` [lustre-devel] " James Simmons
2016-03-12  1:29 ` [PATCH 09/10] staging: lustre: report minimum of two buffers for LNet selftest load test James Simmons
2016-03-12  1:29   ` [lustre-devel] " James Simmons
2016-03-12  1:29 ` [PATCH 10/10] staging: lustre: fix aligments in lnet selftest James Simmons
2016-03-12  1:29   ` [lustre-devel] " James Simmons

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.