[SCSI] use scmd_id(), scmd_channel() throughout code
Wrap a highly common idiom. Makes the code easier to read, helps pave the way for sdev->{id,channel} removal, and adds a token that can easily by grepped-for in the future. There are a couple sdev_id() and scmd_printk() updates thrown in as well. Rejections fixed up and Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:

committed by
James Bottomley

orang tua
017560fca4
melakukan
422c0d61d5
@@ -1822,7 +1822,7 @@ static irqreturn_t ihdlr(int irq, unsigned int j) {
|
||||
|
||||
/* If there was a bus reset, redo operation on each target */
|
||||
else if (tstatus != GOOD && SCpnt->device->type == TYPE_DISK
|
||||
&& HD(j)->target_redo[SCpnt->device->id][SCpnt->device->channel])
|
||||
&& HD(j)->target_redo[scmd_id(SCpnt)][scmd_channel(SCpnt)])
|
||||
status = DID_BUS_BUSY << 16;
|
||||
|
||||
/* Works around a flaw in scsi.c */
|
||||
@@ -1835,29 +1835,28 @@ static irqreturn_t ihdlr(int irq, unsigned int j) {
|
||||
status = DID_OK << 16;
|
||||
|
||||
if (tstatus == GOOD)
|
||||
HD(j)->target_redo[SCpnt->device->id][SCpnt->device->channel] = FALSE;
|
||||
HD(j)->target_redo[scmd_id(SCpnt)][scmd_channel(SCpnt)] = FALSE;
|
||||
|
||||
if (spp->target_status && SCpnt->device->type == TYPE_DISK &&
|
||||
(!(tstatus == CHECK_CONDITION && HD(j)->iocount <= 1000 &&
|
||||
(SCpnt->sense_buffer[2] & 0xf) == NOT_READY)))
|
||||
printk("%s: ihdlr, target %d.%d:%d, pid %ld, "\
|
||||
"target_status 0x%x, sense key 0x%x.\n", BN(j),
|
||||
SCpnt->device->channel, SCpnt->device->id, SCpnt->device->lun,
|
||||
scmd_printk(KERN_INFO, SCpnt,
|
||||
"ihdlr, pid %ld, target_status 0x%x, sense key 0x%x.\n",
|
||||
SCpnt->pid, spp->target_status,
|
||||
SCpnt->sense_buffer[2]);
|
||||
|
||||
HD(j)->target_to[SCpnt->device->id][SCpnt->device->channel] = 0;
|
||||
HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)] = 0;
|
||||
|
||||
if (HD(j)->last_retried_pid == SCpnt->pid) HD(j)->retries = 0;
|
||||
|
||||
break;
|
||||
case ASST: /* Selection Time Out */
|
||||
|
||||
if (HD(j)->target_to[SCpnt->device->id][SCpnt->device->channel] > 1)
|
||||
if (HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)] > 1)
|
||||
status = DID_ERROR << 16;
|
||||
else {
|
||||
status = DID_TIME_OUT << 16;
|
||||
HD(j)->target_to[SCpnt->device->id][SCpnt->device->channel]++;
|
||||
HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)]++;
|
||||
}
|
||||
|
||||
break;
|
||||
|
Reference in New Issue
Block a user