[SCSI] arcmsr: fix misuse of | instead of &

ARCMSR_ARC1880_DiagWrite_ENABLE is 0x00000080 so (x | 0x00000080) is
never zero.  The intent here was to test that loop until
ARCMSR_ARC1880_DiagWrite_ENABLE was turned on, but because the test was
wrong, we would do five loops regardless of whether it succeed or not.

Also I simplified the condition a little by removing the unused
assignement.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Nick Cheng <nick.cheng@areca.com.tw>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
Dan Carpenter 2012-06-09 12:10:19 +03:00 committed by James Bottomley
parent 23f0bb47a4
commit 6ad819b06d
1 changed files with 2 additions and 2 deletions

View File

@ -2821,7 +2821,7 @@ static void arcmsr_hardware_reset(struct AdapterControlBlock *acb)
int i, count = 0; int i, count = 0;
struct MessageUnit_A __iomem *pmuA = acb->pmuA; struct MessageUnit_A __iomem *pmuA = acb->pmuA;
struct MessageUnit_C __iomem *pmuC = acb->pmuC; struct MessageUnit_C __iomem *pmuC = acb->pmuC;
u32 temp = 0;
/* backup pci config data */ /* backup pci config data */
printk(KERN_NOTICE "arcmsr%d: executing hw bus reset .....\n", acb->host->host_no); printk(KERN_NOTICE "arcmsr%d: executing hw bus reset .....\n", acb->host->host_no);
for (i = 0; i < 64; i++) { for (i = 0; i < 64; i++) {
@ -2839,7 +2839,7 @@ static void arcmsr_hardware_reset(struct AdapterControlBlock *acb)
writel(0x2, &pmuC->write_sequence); writel(0x2, &pmuC->write_sequence);
writel(0x7, &pmuC->write_sequence); writel(0x7, &pmuC->write_sequence);
writel(0xD, &pmuC->write_sequence); writel(0xD, &pmuC->write_sequence);
} while ((((temp = readl(&pmuC->host_diagnostic)) | ARCMSR_ARC1880_DiagWrite_ENABLE) == 0) && (count < 5)); } while (((readl(&pmuC->host_diagnostic) & ARCMSR_ARC1880_DiagWrite_ENABLE) == 0) && (count < 5));
writel(ARCMSR_ARC1880_RESET_ADAPTER, &pmuC->host_diagnostic); writel(ARCMSR_ARC1880_RESET_ADAPTER, &pmuC->host_diagnostic);
} else { } else {
pci_write_config_byte(acb->pdev, 0x84, 0x20); pci_write_config_byte(acb->pdev, 0x84, 0x20);