Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1670469

[PATCH] staging: lustre: lnet: selftest: Change the type of variable to bool

From simran singhal <singhalsimran0@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] staging: lustre: lnet: selftest: Change the type of variable to bool
Date 2017-06-20 11:10 +0200
Message-ID <tUnkD-6DB-29@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


This patch changes the type of variable done from int to boolean. As it
is been used as a boolean in the function sfw_test_rpc_done(). It also
makes the code more readable and bool data type also requires less
memory in comparison to int data type.

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
---
 drivers/staging/lustre/lnet/selftest/framework.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index ef27bff..3789df6 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -869,7 +869,7 @@ sfw_test_rpc_done(struct srpc_client_rpc *rpc)
 {
 	struct sfw_test_unit *tsu = rpc->crpc_priv;
 	struct sfw_test_instance *tsi = tsu->tsu_instance;
-	int done = 0;
+	bool done = false;
 
 	tsi->tsi_ops->tso_done_rpc(tsu, rpc);
 
@@ -883,7 +883,7 @@ sfw_test_rpc_done(struct srpc_client_rpc *rpc)
 	/* batch is stopping or loop is done or get error */
 	if (tsi->tsi_stopping || !tsu->tsu_loop ||
 	    (rpc->crpc_status && tsi->tsi_stoptsu_onerr))
-		done = 1;
+		done = true;
 
 	/* dec ref for poster */
 	srpc_client_rpc_decref(rpc);
-- 
2.7.4

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] staging: lustre: lnet: selftest: Change the type of variable  to bool simran singhal <singhalsimran0@gmail.com> - 2017-06-20 11:10 +0200
  Re: [PATCH] staging: lustre: lnet: selftest: Change the type of  variable to bool Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-23 22:30 +0200

csiph-web