You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[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
parent
017560fca4
commit
422c0d61d5
@@ -1247,13 +1247,13 @@ static void collect_stats(struct NCR5380_hostdata *hostdata, Scsi_Cmnd * cmd)
|
||||
case WRITE:
|
||||
case WRITE_6:
|
||||
case WRITE_10:
|
||||
hostdata->time_write[cmd->device->id] += (jiffies - hostdata->timebase);
|
||||
hostdata->time_write[scmd_id(cmd)] += (jiffies - hostdata->timebase);
|
||||
hostdata->pendingw--;
|
||||
break;
|
||||
case READ:
|
||||
case READ_6:
|
||||
case READ_10:
|
||||
hostdata->time_read[cmd->device->id] += (jiffies - hostdata->timebase);
|
||||
hostdata->time_read[scmd_id(cmd)] += (jiffies - hostdata->timebase);
|
||||
hostdata->pendingr--;
|
||||
break;
|
||||
}
|
||||
@@ -1385,7 +1385,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag)
|
||||
* the host and target ID's on the SCSI bus.
|
||||
*/
|
||||
|
||||
NCR5380_write(OUTPUT_DATA_REG, (hostdata->id_mask | (1 << cmd->device->id)));
|
||||
NCR5380_write(OUTPUT_DATA_REG, (hostdata->id_mask | (1 << scmd_id(cmd))));
|
||||
|
||||
/*
|
||||
* Raise ATN while SEL is true before BSY goes false from arbitration,
|
||||
@@ -1430,7 +1430,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag)
|
||||
|
||||
udelay(1);
|
||||
|
||||
dprintk(NDEBUG_SELECTION, ("scsi%d : selecting target %d\n", instance->host_no, cmd->device->id));
|
||||
dprintk(NDEBUG_SELECTION, ("scsi%d : selecting target %d\n", instance->host_no, scmd_id(cmd)));
|
||||
|
||||
/*
|
||||
* The SCSI specification calls for a 250 ms timeout for the actual
|
||||
@@ -1483,7 +1483,7 @@ part2:
|
||||
|
||||
if (!(NCR5380_read(STATUS_REG) & SR_BSY)) {
|
||||
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
|
||||
if (hostdata->targets_present & (1 << cmd->device->id)) {
|
||||
if (hostdata->targets_present & (1 << scmd_id(cmd))) {
|
||||
printk(KERN_DEBUG "scsi%d : weirdness\n", instance->host_no);
|
||||
if (hostdata->restart_select)
|
||||
printk(KERN_DEBUG "\trestart select\n");
|
||||
@@ -1499,7 +1499,7 @@ part2:
|
||||
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
|
||||
return 0;
|
||||
}
|
||||
hostdata->targets_present |= (1 << cmd->device->id);
|
||||
hostdata->targets_present |= (1 << scmd_id(cmd));
|
||||
|
||||
/*
|
||||
* Since we followed the SCSI spec, and raised ATN while SEL
|
||||
|
||||
Reference in New Issue
Block a user