* [PATCH] scsi: arcmsr: clean up clang warning on extraneous parentheses
@ 2018-09-30 23:03 Colin King
2018-09-30 23:18 ` Joe Perches
2018-10-11 3:22 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2018-09-30 23:03 UTC (permalink / raw)
To: James E . J . Bottomley, Martin K . Petersen, Ching Huang, linux-scsi
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
There are extraneous parantheses that are causing clang to produce a
warning so remove these.
Clean up 3 clang warnings:
equality comparison with extraneous parentheses [-Wparentheses-equality]
Signed-off-by: Colin Ian King <colin.king@canonical.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.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: arcmsr: clean up clang warning on extraneous parentheses
2018-09-30 23:03 [PATCH] scsi: arcmsr: clean up clang warning on extraneous parentheses Colin King
@ 2018-09-30 23:18 ` Joe Perches
2018-10-11 3:22 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2018-09-30 23:18 UTC (permalink / raw)
To: Colin King, James E . J . Bottomley, Martin K . Petersen,
Ching Huang, linux-scsi
Cc: kernel-janitors, linux-kernel
On Mon, 2018-10-01 at 00:03 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> There are extraneous parantheses that are causing clang to produce a
> warning so remove these.
>
> Clean up 3 clang warnings:
> equality comparison with extraneous parentheses [-Wparentheses-equality]
[]
> diff --git 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);
It'd probably read better using a switch/case like the below:
---
drivers/scsi/arcmsr/arcmsr_hba.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index 12316ef4c893..ad45583f5ae0 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -4135,9 +4135,11 @@ 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)) {
+ switch (acb->dev_id) {
+ case 0x1680:
writel(ARCMSR_ARC1680_BUS_RESET, &pmuA->reserved1[0]);
- } else if ((acb->dev_id == 0x1880)) {
+ break;
+ case 0x1880:
do {
count++;
writel(0xF, &pmuC->write_sequence);
@@ -4148,7 +4150,8 @@ static void arcmsr_hardware_reset(struct AdapterControlBlock *acb)
writel(0xD, &pmuC->write_sequence);
} while (((readl(&pmuC->host_diagnostic) & ARCMSR_ARC1880_DiagWrite_ENABLE) == 0) && (count < 5));
writel(ARCMSR_ARC1880_RESET_ADAPTER, &pmuC->host_diagnostic);
- } else if (acb->dev_id == 0x1884) {
+ break;
+ case 0x1884:
struct MessageUnit_E __iomem *pmuE = acb->pmuE;
do {
count++;
@@ -4161,10 +4164,13 @@ 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)) {
+ break;
+ case 0x1214:
writel(0x20, pmuD->reset_request);
- } else {
+ break;
+ default:
pci_write_config_byte(acb->pdev, 0x84, 0x20);
+ break;
}
msleep(2000);
/* write back pci config data */
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: arcmsr: clean up clang warning on extraneous parentheses
2018-09-30 23:03 [PATCH] scsi: arcmsr: clean up clang warning on extraneous parentheses Colin King
2018-09-30 23:18 ` Joe Perches
@ 2018-10-11 3:22 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2018-10-11 3:22 UTC (permalink / raw)
To: Colin King
Cc: James E . J . Bottomley, Martin K . Petersen, Ching Huang,
linux-scsi, kernel-janitors, linux-kernel
Colin,
> There are extraneous parantheses that are causing clang to produce a
> warning so remove these.
>
> Clean up 3 clang warnings:
> equality comparison with extraneous parentheses [-Wparentheses-equality]
Applied to 4.20/scsi-queue, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-11 3:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-30 23:03 [PATCH] scsi: arcmsr: clean up clang warning on extraneous parentheses Colin King
2018-09-30 23:18 ` Joe Perches
2018-10-11 3:22 ` Martin K. Petersen
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).