Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: "NickCheng" <nick.cheng@areca.com.tw>
To: 'James Bottomley' <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: RE: [Fwd: [patch] [SCSI] arcmsr: fix misuse of | instead of &]
Date: Wed, 20 Jun 2012 09:38:10 +0800	[thread overview]
Message-ID: <02F0C1478CF5442C9D543E3A87B82B82@arecaaebe11fae> (raw)
In-Reply-To: <1340121415.3004.57.camel@dabdike.int.hansenpartnership.com>

Hi James,
Sorry for be late response.
I am OK with it.
-----Original Message-----
From: James Bottomley [mailto:James.Bottomley@HansenPartnership.com] 
Sent: Tuesday, June 19, 2012 11:57 PM
To: Nick Cheng
Subject: [Fwd: [patch] [SCSI] arcmsr: fix misuse of | instead of &]

Is this OK with you?

James

-------- Forwarded Message --------
From: Dan Carpenter <dan.carpenter@oracle.com>
To: James E.J. Bottomley <JBottomley@parallels.com>
Cc: David Howells <dhowells@redhat.com>, Nick Cheng
<nick.cheng@areca.com.tw>, , kernel-janitors@vger.kernel.org
Subject: [patch] [SCSI] arcmsr: fix misuse of | instead of &
Date: Sat, 9 Jun 2012 12:10:19 +0300

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>
---
Static checker stuff.  I do not own this hardware.

diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c
b/drivers/scsi/arcmsr/arcmsr_hba.c
index cbde1dc..def24a1 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -2821,7 +2821,7 @@ static void arcmsr_hardware_reset(struct
AdapterControlBlock *acb)
 	int i, count = 0;
 	struct MessageUnit_A __iomem *pmuA = acb->pmuA;
 	struct MessageUnit_C __iomem *pmuC = acb->pmuC;
-	u32 temp = 0;
+
 	/* backup pci config data */
 	printk(KERN_NOTICE "arcmsr%d: executing hw bus reset .....\n",
acb->host->host_no);
 	for (i = 0; i < 64; i++) {
@@ -2839,7 +2839,7 @@ static void arcmsr_hardware_reset(struct
AdapterControlBlock *acb)
 			writel(0x2, &pmuC->write_sequence);
 			writel(0x7, &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);
 	} else {
 		pci_write_config_byte(acb->pdev, 0x84, 0x20);
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



       reply	other threads:[~2012-06-20  1:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1340121415.3004.57.camel@dabdike.int.hansenpartnership.com>
2012-06-20  1:38 ` NickCheng [this message]
2012-06-20  1:53 ` [Fwd: [patch] [SCSI] arcmsr: fix misuse of | instead of &] NickCheng

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=02F0C1478CF5442C9D543E3A87B82B82@arecaaebe11fae \
    --to=nick.cheng@areca.com.tw \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /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