All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rsxx: Remove unnecessary parentheses
@ 2018-09-11 21:50 Nathan Chancellor
  2018-09-11 21:55 ` Nick Desaulniers
  2018-09-11 22:57 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Chancellor @ 2018-09-11 21:50 UTC (permalink / raw)
  To: Joshua Morris, Philip Kelleher
  Cc: Jens Axboe, linux-block, linux-kernel, Nick Desaulniers,
	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
        if ((cmd->op == CREG_OP_READ)) {
                     ^~
                     =
1 warning generated.

Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 drivers/block/rsxx/cregs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/rsxx/cregs.c b/drivers/block/rsxx/cregs.c
index c148e83e4ed7..d9a8758682c9 100644
--- a/drivers/block/rsxx/cregs.c
+++ b/drivers/block/rsxx/cregs.c
@@ -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 */
-- 
2.18.0

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

* Re: [PATCH] rsxx: Remove unnecessary parentheses
  2018-09-11 21:50 [PATCH] rsxx: Remove unnecessary parentheses Nathan Chancellor
@ 2018-09-11 21:55 ` Nick Desaulniers
  2018-09-11 22:57 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Nick Desaulniers @ 2018-09-11 21:55 UTC (permalink / raw)
  To: Nathan Chancellor; +Cc: josh.h.morris, pjk1939, axboe, linux-block, LKML

On Tue, Sep 11, 2018 at 2:51 PM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> 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.
>
> Reported-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
>  drivers/block/rsxx/cregs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/rsxx/cregs.c b/drivers/block/rsxx/cregs.c
> index c148e83e4ed7..d9a8758682c9 100644
> --- a/drivers/block/rsxx/cregs.c
> +++ b/drivers/block/rsxx/cregs.c
> @@ -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 */
> --
> 2.18.0
>

LGTM
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

-- 
Thanks,
~Nick Desaulniers

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

* Re: [PATCH] rsxx: Remove unnecessary parentheses
  2018-09-11 21:50 [PATCH] rsxx: Remove unnecessary parentheses Nathan Chancellor
  2018-09-11 21:55 ` Nick Desaulniers
@ 2018-09-11 22:57 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2018-09-11 22:57 UTC (permalink / raw)
  To: Nathan Chancellor, Joshua Morris, Philip Kelleher
  Cc: linux-block, linux-kernel, Nick Desaulniers

On 9/11/18 3:50 PM, Nathan Chancellor wrote:
> 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.

Applied for 4.20, thanks.

-- 
Jens Axboe

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

end of thread, other threads:[~2018-09-11 22:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11 21:50 [PATCH] rsxx: Remove unnecessary parentheses Nathan Chancellor
2018-09-11 21:55 ` Nick Desaulniers
2018-09-11 22:57 ` Jens Axboe

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.