rsxx: Remove unnecessary parentheses
PATCH 1/1 rsxx: Remove unnecessary parentheses
Clang warns when more than one set of parentheses is used for a single conditional statement:
drivers/block/rsxx/cregs.c:279:15: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if ((cmd->op == CREG_OP_READ)) {
~~~~~~~~^~~~~~~~~~~~~~~drivers/block/rsxx/cregs.c:279:15: note: remove extraneous parentheses around the comparison to silence this warning
if ((cmd->op == CREG_OP_READ)) {
~ ^ ~drivers/block/rsxx/cregs.c:279:15: note: use '=' to turn this equality comparison into an assignment
if ((cmd->op == CREG_OP_READ)) {
^~
=1 warning generated.
--- drivers/block/rsxx/cregs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/rsxx/cregs.c +1 -1
@@ -276,7 +276,7 @@ static void creg_cmd_done(struct work_struct *work) st = -EIO ; } -if ((cmd->op ==CREG_OP_READ )) { +if (cmd->op ==CREG_OP_READ ) {unsigned int cnt8 =ioread32 (card->regmap +CREG_CNT );/* Paranoid Sanity Checks */
Signature · 1 line
2.18.0
Quoted 39 lines · Nathan Chancellor
Clang warns when more than one set of parentheses is used for a single conditional statement:
drivers/block/rsxx/cregs.c:279:15: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]if ((cmd->op == CREG_OP_READ)) { ~~~~~~~~^~~~~~~~~~~~~~~
drivers/block/rsxx/cregs.c:279:15: note: remove extraneous parentheses around the comparison to silence this warning
if ((cmd->op==CREG_OP_READ)) {
~ ^ ~drivers/block/rsxx/cregs.c:279:15: note: use '=' to turn this equality comparison into an assignmentif ((cmd->op == CREG_OP_READ)) { ^~ =1 warning generated.
Reported-by Nick Desaulniers <[email protected]>Signed-off-by Nathan Chancellor <[email protected]>--- drivers/block/rsxx/cregs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/block/rsxx/cregs.c +1
-2@@ -276,7 +276,7 @@ static void creg_cmd_done(struct work_struct *work) st = -EIO ; } -if ((cmd->op ==CREG_OP_READ )) { +if (cmd->op ==CREG_OP_READ ) {unsigned int cnt8 =ioread32 (card->regmap +CREG_CNT );/* Paranoid Sanity Checks */ --
Quoted 2 lines
2.18.0
LGTM
Signature · 2 lines
Thanks, ~Nick Desaulniers
Jens Axboe
maintainerQuoted 13 lines · Nathan Chancellor
Clang warns when more than one set of parentheses is used for a single conditional statement:
drivers/block/rsxx/cregs.c:279:15: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]if ((cmd->op == CREG_OP_READ)) { ~~~~~~~~^~~~~~~~~~~~~~~
drivers/block/rsxx/cregs.c:279:15: note: remove extraneous parentheses around the comparison to silence this warning
if ((cmd->op==CREG_OP_READ)) {
~ ^ ~drivers/block/rsxx/cregs.c:279:15: note: use '=' to turn this equality comparison into an assignment
Quoted 4 lines
if ((cmd->op == CREG_OP_READ)) { ^~ =1 warning generated.
Applied for 4.20, thanks.
Signature · 1 line
Jens Axboe