Commit d647c783 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by James Bottomley

advansys: use 'bool' instead of 'int'

Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent 0ce53822
...@@ -3801,17 +3801,17 @@ static int AscStopChip(PortAddr iop_base) ...@@ -3801,17 +3801,17 @@ static int AscStopChip(PortAddr iop_base)
return (1); return (1);
} }
static int AscIsChipHalted(PortAddr iop_base) static bool AscIsChipHalted(PortAddr iop_base)
{ {
if ((AscGetChipStatus(iop_base) & CSW_HALTED) != 0) { if ((AscGetChipStatus(iop_base) & CSW_HALTED) != 0) {
if ((AscGetChipControl(iop_base) & CC_HALT) != 0) { if ((AscGetChipControl(iop_base) & CC_HALT) != 0) {
return (1); return true;
} }
} }
return (0); return false;
} }
static int AscResetChipAndScsiBus(ASC_DVC_VAR *asc_dvc) static bool AscResetChipAndScsiBus(ASC_DVC_VAR *asc_dvc)
{ {
PortAddr iop_base; PortAddr iop_base;
int i = 10; int i = 10;
...@@ -6446,11 +6446,11 @@ AscCalSDTRData(ASC_DVC_VAR *asc_dvc, uchar sdtr_period, uchar syn_offset) ...@@ -6446,11 +6446,11 @@ AscCalSDTRData(ASC_DVC_VAR *asc_dvc, uchar sdtr_period, uchar syn_offset)
return byte; return byte;
} }
static int AscSetChipSynRegAtID(PortAddr iop_base, uchar id, uchar sdtr_data) static bool AscSetChipSynRegAtID(PortAddr iop_base, uchar id, uchar sdtr_data)
{ {
ASC_SCSI_BIT_ID_TYPE org_id; ASC_SCSI_BIT_ID_TYPE org_id;
int i; int i;
int sta = TRUE; bool sta = true;
AscSetBank(iop_base, 1); AscSetBank(iop_base, 1);
org_id = AscReadChipDvcID(iop_base); org_id = AscReadChipDvcID(iop_base);
...@@ -6464,10 +6464,10 @@ static int AscSetChipSynRegAtID(PortAddr iop_base, uchar id, uchar sdtr_data) ...@@ -6464,10 +6464,10 @@ static int AscSetChipSynRegAtID(PortAddr iop_base, uchar id, uchar sdtr_data)
AscSetBank(iop_base, 0); AscSetBank(iop_base, 0);
AscSetChipSyn(iop_base, sdtr_data); AscSetChipSyn(iop_base, sdtr_data);
if (AscGetChipSyn(iop_base) != sdtr_data) { if (AscGetChipSyn(iop_base) != sdtr_data) {
sta = FALSE; sta = false;
} }
} else { } else {
sta = FALSE; sta = false;
} }
AscSetBank(iop_base, 1); AscSetBank(iop_base, 1);
AscWriteChipDvcID(iop_base, org_id); AscWriteChipDvcID(iop_base, org_id);
...@@ -7527,32 +7527,32 @@ static irqreturn_t advansys_interrupt(int irq, void *dev_id) ...@@ -7527,32 +7527,32 @@ static irqreturn_t advansys_interrupt(int irq, void *dev_id)
return result; return result;
} }
static int AscHostReqRiscHalt(PortAddr iop_base) static bool AscHostReqRiscHalt(PortAddr iop_base)
{ {
int count = 0; int count = 0;
int sta = 0; bool sta = false;
uchar saved_stop_code; uchar saved_stop_code;
if (AscIsChipHalted(iop_base)) if (AscIsChipHalted(iop_base))
return (1); return true;
saved_stop_code = AscReadLramByte(iop_base, ASCV_STOP_CODE_B); saved_stop_code = AscReadLramByte(iop_base, ASCV_STOP_CODE_B);
AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, AscWriteLramByte(iop_base, ASCV_STOP_CODE_B,
ASC_STOP_HOST_REQ_RISC_HALT | ASC_STOP_REQ_RISC_STOP); ASC_STOP_HOST_REQ_RISC_HALT | ASC_STOP_REQ_RISC_STOP);
do { do {
if (AscIsChipHalted(iop_base)) { if (AscIsChipHalted(iop_base)) {
sta = 1; sta = true;
break; break;
} }
mdelay(100); mdelay(100);
} while (count++ < 20); } while (count++ < 20);
AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, saved_stop_code); AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, saved_stop_code);
return (sta); return sta;
} }
static int static bool
AscSetRunChipSynRegAtID(PortAddr iop_base, uchar tid_no, uchar sdtr_data) AscSetRunChipSynRegAtID(PortAddr iop_base, uchar tid_no, uchar sdtr_data)
{ {
int sta = FALSE; bool sta = false;
if (AscHostReqRiscHalt(iop_base)) { if (AscHostReqRiscHalt(iop_base)) {
sta = AscSetChipSynRegAtID(iop_base, tid_no, sdtr_data); sta = AscSetChipSynRegAtID(iop_base, tid_no, sdtr_data);
...@@ -9447,7 +9447,7 @@ static ushort AscInitFromEEP(ASC_DVC_VAR *asc_dvc) ...@@ -9447,7 +9447,7 @@ static ushort AscInitFromEEP(ASC_DVC_VAR *asc_dvc)
AscResetChipAndScsiBus(asc_dvc); AscResetChipAndScsiBus(asc_dvc);
mdelay(asc_dvc->scsi_reset_wait * 1000); /* XXX: msleep? */ mdelay(asc_dvc->scsi_reset_wait * 1000); /* XXX: msleep? */
} }
if (AscIsChipHalted(iop_base) == FALSE) { if (!AscIsChipHalted(iop_base)) {
asc_dvc->err_code |= ASC_IERR_START_STOP_CHIP; asc_dvc->err_code |= ASC_IERR_START_STOP_CHIP;
return (warn_code); return (warn_code);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment