Skip to contentSkip to conversation

staging: lusture: mgc: Bool tests do not need comparison

PATCH Superseded Bhaktipriya Shridhar 1 participant 1 message Feb 21, 2016 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lusture: mgc: Bool tests do not need comparison

Bool initializations should use true and false thus bool tests don't need an explicit comparison.

This issue was found using the following Coccinelle script:
@@
bool x;
symbol true;
symbol false;
@@

(
- x == true
+ x
|
- true == x
+ x
|
- x != true
+ !x
|
- true != x
+ !x
|
- x == false
+ !x
|
- false == x
+ !x
|
- x != false
+ x
|
- false != x
+ x
)

---
 drivers/staging/lustre/lustre/mgc/mgc_request.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/mgc/mgc_request.c +1 -1
index 9764e57..e12ad39 100644
@@ -1378,7 +1378,7 @@ again:
 	eof = res->mcr_offset == res->mcr_size;
 
 	CDEBUG(D_INFO, "Latest version %lld, more %d.\n",
-	       res->mcr_offset, eof == false);
+	       res->mcr_offset, !eof);
 
 	ealen = sptlrpc_cli_unwrap_bulk_read(req, req->rq_bulk, 0);
 	if (ealen < 0) {

--
2.1.4