linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nathan Chancellor <natechancellor@gmail.com>
Subject: [PATCH] scsi: arcmsr: Remove unnecessary parentheses
Date: Thu, 20 Sep 2018 13:55:23 -0700	[thread overview]
Message-ID: <20180920205523.4705-1-natechancellor@gmail.com> (raw)

Clang warns when multiple pairs of parentheses are used for a single
conditional statement.

drivers/scsi/arcmsr/arcmsr_hba.c:4138:19: warning: equality comparison
with extraneous parentheses [-Wparentheses-equality]
        if ((acb->dev_id == 0x1680)) {
             ~~~~~~~~~~~~^~~~~~~~~
drivers/scsi/arcmsr/arcmsr_hba.c:4138:19: note: remove extraneous
parentheses around the comparison to silence this warning
        if ((acb->dev_id == 0x1680)) {
            ~            ^        ~
drivers/scsi/arcmsr/arcmsr_hba.c:4138:19: note: use '=' to turn this
equality comparison into an assignment
        if ((acb->dev_id == 0x1680)) {
                         ^~
                         =
drivers/scsi/arcmsr/arcmsr_hba.c:4140:26: warning: equality comparison
with extraneous parentheses [-Wparentheses-equality]
        } else if ((acb->dev_id == 0x1880)) {
                    ~~~~~~~~~~~~^~~~~~~~~
drivers/scsi/arcmsr/arcmsr_hba.c:4140:26: note: remove extraneous
parentheses around the comparison to silence this warning
        } else if ((acb->dev_id == 0x1880)) {
                   ~            ^        ~
drivers/scsi/arcmsr/arcmsr_hba.c:4140:26: note: use '=' to turn this
equality comparison into an assignment
        } else if ((acb->dev_id == 0x1880)) {
                                ^~
                                =
drivers/scsi/arcmsr/arcmsr_hba.c:4164:26: warning: equality comparison
with extraneous parentheses [-Wparentheses-equality]
        } else if ((acb->dev_id == 0x1214)) {
                    ~~~~~~~~~~~~^~~~~~~~~
drivers/scsi/arcmsr/arcmsr_hba.c:4164:26: note: remove extraneous
parentheses around the comparison to silence this warning
        } else if ((acb->dev_id == 0x1214)) {
                   ~            ^        ~
drivers/scsi/arcmsr/arcmsr_hba.c:4164:26: note: use '=' to turn this
equality comparison into an assignment
        } else if ((acb->dev_id == 0x1214)) {
                                ^~
                                =
3 warnings generated.

Link: https://github.com/ClangBuiltLinux/linux/issues/146
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 drivers/scsi/arcmsr/arcmsr_hba.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index cc0be4651128..22cf697adab0 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -4135,9 +4135,9 @@ static void arcmsr_hardware_reset(struct AdapterControlBlock *acb)
 		pci_read_config_byte(acb->pdev, i, &value[i]);
 	}
 	/* hardware reset signal */
-	if ((acb->dev_id == 0x1680)) {
+	if (acb->dev_id == 0x1680) {
 		writel(ARCMSR_ARC1680_BUS_RESET, &pmuA->reserved1[0]);
-	} else if ((acb->dev_id == 0x1880)) {
+	} else if (acb->dev_id == 0x1880) {
 		do {
 			count++;
 			writel(0xF, &pmuC->write_sequence);
@@ -4161,7 +4161,7 @@ static void arcmsr_hardware_reset(struct AdapterControlBlock *acb)
 		} while (((readl(&pmuE->host_diagnostic_3xxx) &
 			ARCMSR_ARC1884_DiagWrite_ENABLE) == 0) && (count < 5));
 		writel(ARCMSR_ARC188X_RESET_ADAPTER, &pmuE->host_diagnostic_3xxx);
-	} else if ((acb->dev_id == 0x1214)) {
+	} else if (acb->dev_id == 0x1214) {
 		writel(0x20, pmuD->reset_request);
 	} else {
 		pci_write_config_byte(acb->pdev, 0x84, 0x20);
-- 
2.19.0


                 reply	other threads:[~2018-09-20 20:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180920205523.4705-1-natechancellor@gmail.com \
    --to=natechancellor@gmail.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).