All of lore.kernel.org
 help / color / mirror / Atom feed
* [lustre-devel] [PATCH] staging: lustre: lnet: selftest: Change the type of variable to bool
@ 2017-06-20  9:06 ` simran singhal
  0 siblings, 0 replies; 4+ messages in thread
From: simran singhal @ 2017-06-20  9:06 UTC (permalink / raw)
  To: Oleg Drokin
  Cc: Andreas Dilger, James Simmons, Greg Kroah-Hartman, lustre-devel,
	devel, linux-kernel

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

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

* [PATCH] staging: lustre: lnet: selftest: Change the type of variable to bool
@ 2017-06-20  9:06 ` simran singhal
  0 siblings, 0 replies; 4+ messages in thread
From: simran singhal @ 2017-06-20  9:06 UTC (permalink / raw)
  To: Oleg Drokin
  Cc: Andreas Dilger, James Simmons, Greg Kroah-Hartman, lustre-devel,
	devel, linux-kernel

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

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

* [lustre-devel] [PATCH] staging: lustre: lnet: selftest: Change the type of variable to bool
  2017-06-20  9:06 ` simran singhal
@ 2017-06-23 16:16   ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-23 16:16 UTC (permalink / raw)
  To: simran singhal
  Cc: Oleg Drokin, devel, linux-kernel, Andreas Dilger, lustre-devel

On Tue, Jun 20, 2017 at 02:36:37PM +0530, simran singhal wrote:
> 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.

Are you sure it takes less memory?  What is the difference before and
after your patch?  Don't make claims without having a way to back them
up :)

thanks,

greg k-h

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

* Re: [PATCH] staging: lustre: lnet: selftest: Change the type of variable to bool
@ 2017-06-23 16:16   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-23 16:16 UTC (permalink / raw)
  To: simran singhal
  Cc: Oleg Drokin, devel, linux-kernel, Andreas Dilger, lustre-devel

On Tue, Jun 20, 2017 at 02:36:37PM +0530, simran singhal wrote:
> 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.

Are you sure it takes less memory?  What is the difference before and
after your patch?  Don't make claims without having a way to back them
up :)

thanks,

greg k-h

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

end of thread, other threads:[~2017-06-23 20:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-20  9:06 [lustre-devel] [PATCH] staging: lustre: lnet: selftest: Change the type of variable to bool simran singhal
2017-06-20  9:06 ` simran singhal
2017-06-23 16:16 ` [lustre-devel] " Greg Kroah-Hartman
2017-06-23 16:16   ` Greg Kroah-Hartman

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.