Commit 6a162836 authored by Finn Thain's avatar Finn Thain Committed by Martin K. Petersen

scsi: NCR5380: Reduce goto statements in NCR5380_select()

Replace a 'goto' statement with a simple 'return' where possible.  This
improves readability. No functional change.
Tested-by: default avatarMichael Schmitz <schmitzmic@gmail.com>
Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 1aeeeed7
...@@ -984,7 +984,7 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance, ...@@ -984,7 +984,7 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance,
if (!hostdata->selecting) { if (!hostdata->selecting) {
/* Command was aborted */ /* Command was aborted */
NCR5380_write(MODE_REG, MR_BASE); NCR5380_write(MODE_REG, MR_BASE);
goto out; return NULL;
} }
if (err < 0) { if (err < 0) {
NCR5380_write(MODE_REG, MR_BASE); NCR5380_write(MODE_REG, MR_BASE);
...@@ -1033,7 +1033,7 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance, ...@@ -1033,7 +1033,7 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance,
if (!hostdata->selecting) { if (!hostdata->selecting) {
NCR5380_write(MODE_REG, MR_BASE); NCR5380_write(MODE_REG, MR_BASE);
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
goto out; return NULL;
} }
dsprintk(NDEBUG_ARBITRATION, instance, "won arbitration\n"); dsprintk(NDEBUG_ARBITRATION, instance, "won arbitration\n");
...@@ -1116,13 +1116,16 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance, ...@@ -1116,13 +1116,16 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance,
spin_lock_irq(&hostdata->lock); spin_lock_irq(&hostdata->lock);
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
/* Can't touch cmd if it has been reclaimed by the scsi ML */ /* Can't touch cmd if it has been reclaimed by the scsi ML */
if (hostdata->selecting) { if (!hostdata->selecting)
cmd->result = DID_BAD_TARGET << 16; return NULL;
complete_cmd(instance, cmd);
dsprintk(NDEBUG_SELECTION, instance, "target did not respond within 250ms\n"); cmd->result = DID_BAD_TARGET << 16;
cmd = NULL; complete_cmd(instance, cmd);
} dsprintk(NDEBUG_SELECTION, instance,
"target did not respond within 250ms\n");
cmd = NULL;
goto out; goto out;
} }
...@@ -1155,7 +1158,7 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance, ...@@ -1155,7 +1158,7 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance,
} }
if (!hostdata->selecting) { if (!hostdata->selecting) {
do_abort(instance); do_abort(instance);
goto out; return NULL;
} }
dsprintk(NDEBUG_SELECTION, instance, "target %d selected, going into MESSAGE OUT phase.\n", dsprintk(NDEBUG_SELECTION, instance, "target %d selected, going into MESSAGE OUT phase.\n",
......
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