staging: lustre: mgc: Bool tests do not need comparison
PATCH v2 1/1 staging: lustre: 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
)
---
Changes in v2:
-Fixed typo "lusture" to "lustre" in the subject
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
@@ -1394,7 +1394,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
Greg KH
maintainerQuoted 49 lines · Bhaktipriya Shridhar
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
)Signed-off-by Bhaktipriya Shridhar <[email protected]>---
Changes in v2:
-Fixed typo "lusture" to "lustre" in the subjectdrivers/staging/lustre/lustre/mgc/mgc_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/lustre/lustre/mgc/mgc_request.c +0
-0
drivers/staging/lustre/lustre/mgc/mgc_request.c again: · line 1397
Quoted 5 lines
drivers/staging/lustre/lustre/mgc/mgc_request.c +1
-1@@ -1394,7 +1394,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);
eek, that's horrid to try to read, can you understand that now?
Please don't do that.
greg k-h
Greg KH
maintainerQuoted 49 lines · Bhaktipriya Shridhar
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
)Signed-off-by Bhaktipriya Shridhar <[email protected]>---
Changes in v2:
-Fixed typo "lusture" to "lustre" in the subjectdrivers/staging/lustre/lustre/mgc/mgc_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/lustre/lustre/mgc/mgc_request.c +0
-0
drivers/staging/lustre/lustre/mgc/mgc_request.c again: · line 1397
Quoted 5 lines
drivers/staging/lustre/lustre/mgc/mgc_request.c +1
-1@@ -1394,7 +1394,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);
eek, that's horrid to try to read, can you understand that now?
Please don't do that.
greg k-h