public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail.com>
To: James.Bottomley@HansenPartnership.com
Cc: linux-scsi@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] cleanup FlashPoint_HardwareResetHostAdapter()
Date: Tue, 21 Jul 2009 13:38:12 +0200	[thread overview]
Message-ID: <4A65A8A4.2000506@gmail.com> (raw)

cleanups for FlashPoint_HardwareResetHostAdapter()

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
This shouldn't cause semantics.

diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c
index b898d38..b917975 100644
--- a/drivers/scsi/FlashPoint.c
+++ b/drivers/scsi/FlashPoint.c
@@ -1212,32 +1212,25 @@ static unsigned long FlashPoint_HardwareResetHostAdapter(struct sccb_mgr_info
 
 	ioport = pCardInfo->si_baseaddr;
 
-	for (thisCard = 0; thisCard <= MAX_CARDS; thisCard++) {
-
-		if (thisCard == MAX_CARDS) {
-
-			return FAILURE;
-		}
+	for (thisCard = 0; thisCard < MAX_CARDS; thisCard++) {
 
 		if (FPT_BL_Card[thisCard].ioPort == ioport) {
 
 			CurrCard = &FPT_BL_Card[thisCard];
 			FPT_SccbMgrTableInitCard(CurrCard, thisCard);
 			break;
-		}
 
-		else if (FPT_BL_Card[thisCard].ioPort == 0x00) {
+		} else if (FPT_BL_Card[thisCard].ioPort == 0x00) {
 
 			FPT_BL_Card[thisCard].ioPort = ioport;
 			CurrCard = &FPT_BL_Card[thisCard];
 
-			if (FPT_mbCards)
-				for (i = 0; i < FPT_mbCards; i++) {
-					if (CurrCard->ioPort ==
-					    FPT_nvRamInfo[i].niBaseAddr)
-						CurrCard->pNvRamInfo =
-						    &FPT_nvRamInfo[i];
-				}
+			for (i = 0; i < FPT_mbCards; i++) {
+				if (CurrCard->ioPort ==
+						FPT_nvRamInfo[i].niBaseAddr)
+					CurrCard->pNvRamInfo =
+						&FPT_nvRamInfo[i];
+			}
 			FPT_SccbMgrTableInitCard(CurrCard, thisCard);
 			CurrCard->cardIndex = thisCard;
 			CurrCard->cardInfo = pCardInfo;
@@ -1245,23 +1238,23 @@ static unsigned long FlashPoint_HardwareResetHostAdapter(struct sccb_mgr_info
 			break;
 		}
 	}
+	if (thisCard == MAX_CARDS)
+		return FAILURE;
 
 	pCurrNvRam = CurrCard->pNvRamInfo;
 
-	if (pCurrNvRam) {
+	if (pCurrNvRam)
 		ScamFlg = pCurrNvRam->niScamConf;
-	} else {
+	else
 		ScamFlg =
 		    (unsigned char)FPT_utilEERead(ioport, SCAM_CONFIG / 2);
-	}
 
 	FPT_BusMasterInit(ioport);
 	FPT_XbowInit(ioport, ScamFlg);
 
 	FPT_autoLoadDefaultMap(ioport);
 
-	for (i = 0, id = 0x01; i != pCardInfo->si_id; i++, id <<= 1) {
-	}
+	id = 0x01 << pCardInfo->si_id;
 
 	WR_HARPOON(ioport + hp_selfid_0, id);
 	WR_HARPOON(ioport + hp_selfid_1, 0x00);

             reply	other threads:[~2009-07-21 11:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-21 11:38 Roel Kluin [this message]
2009-07-24  0:19 ` [PATCH] cleanup FlashPoint_HardwareResetHostAdapter() Andrew Morton

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=4A65A8A4.2000506@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@linux-foundation.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