cleanups for FlashPoint_HardwareResetHostAdapter() Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx> --- 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); -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html