diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-24 18:05:09 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-10-28 22:10:16 -0400 |
commit | 422c0d61d591cbfb70f029e13505fb437e169d68 (patch) | |
tree | ebafa14e1c1564ddf263868c3b6907642a8fdf1e /drivers/scsi/u14-34f.c | |
parent | 017560fca496f72ed9dd734ffde63ce39dfe0411 (diff) |
[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>
Diffstat (limited to 'drivers/scsi/u14-34f.c')
-rw-r--r-- | drivers/scsi/u14-34f.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c index e778e17d57f0..cfab8f197084 100644 --- a/drivers/scsi/u14-34f.c +++ b/drivers/scsi/u14-34f.c | |||
@@ -1822,7 +1822,7 @@ static irqreturn_t ihdlr(int irq, unsigned int j) { | |||
1822 | 1822 | ||
1823 | /* If there was a bus reset, redo operation on each target */ | 1823 | /* If there was a bus reset, redo operation on each target */ |
1824 | else if (tstatus != GOOD && SCpnt->device->type == TYPE_DISK | 1824 | else if (tstatus != GOOD && SCpnt->device->type == TYPE_DISK |
1825 | && HD(j)->target_redo[SCpnt->device->id][SCpnt->device->channel]) | 1825 | && HD(j)->target_redo[scmd_id(SCpnt)][scmd_channel(SCpnt)]) |
1826 | status = DID_BUS_BUSY << 16; | 1826 | status = DID_BUS_BUSY << 16; |
1827 | 1827 | ||
1828 | /* Works around a flaw in scsi.c */ | 1828 | /* Works around a flaw in scsi.c */ |
@@ -1835,29 +1835,28 @@ static irqreturn_t ihdlr(int irq, unsigned int j) { | |||
1835 | status = DID_OK << 16; | 1835 | status = DID_OK << 16; |
1836 | 1836 | ||
1837 | if (tstatus == GOOD) | 1837 | if (tstatus == GOOD) |
1838 | HD(j)->target_redo[SCpnt->device->id][SCpnt->device->channel] = FALSE; | 1838 | HD(j)->target_redo[scmd_id(SCpnt)][scmd_channel(SCpnt)] = FALSE; |
1839 | 1839 | ||
1840 | if (spp->target_status && SCpnt->device->type == TYPE_DISK && | 1840 | if (spp->target_status && SCpnt->device->type == TYPE_DISK && |
1841 | (!(tstatus == CHECK_CONDITION && HD(j)->iocount <= 1000 && | 1841 | (!(tstatus == CHECK_CONDITION && HD(j)->iocount <= 1000 && |
1842 | (SCpnt->sense_buffer[2] & 0xf) == NOT_READY))) | 1842 | (SCpnt->sense_buffer[2] & 0xf) == NOT_READY))) |
1843 | printk("%s: ihdlr, target %d.%d:%d, pid %ld, "\ | 1843 | scmd_printk(KERN_INFO, SCpnt, |
1844 | "target_status 0x%x, sense key 0x%x.\n", BN(j), | 1844 | "ihdlr, pid %ld, target_status 0x%x, sense key 0x%x.\n", |
1845 | SCpnt->device->channel, SCpnt->device->id, SCpnt->device->lun, | ||
1846 | SCpnt->pid, spp->target_status, | 1845 | SCpnt->pid, spp->target_status, |
1847 | SCpnt->sense_buffer[2]); | 1846 | SCpnt->sense_buffer[2]); |
1848 | 1847 | ||
1849 | HD(j)->target_to[SCpnt->device->id][SCpnt->device->channel] = 0; | 1848 | HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)] = 0; |
1850 | 1849 | ||
1851 | if (HD(j)->last_retried_pid == SCpnt->pid) HD(j)->retries = 0; | 1850 | if (HD(j)->last_retried_pid == SCpnt->pid) HD(j)->retries = 0; |
1852 | 1851 | ||
1853 | break; | 1852 | break; |
1854 | case ASST: /* Selection Time Out */ | 1853 | case ASST: /* Selection Time Out */ |
1855 | 1854 | ||
1856 | if (HD(j)->target_to[SCpnt->device->id][SCpnt->device->channel] > 1) | 1855 | if (HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)] > 1) |
1857 | status = DID_ERROR << 16; | 1856 | status = DID_ERROR << 16; |
1858 | else { | 1857 | else { |
1859 | status = DID_TIME_OUT << 16; | 1858 | status = DID_TIME_OUT << 16; |
1860 | HD(j)->target_to[SCpnt->device->id][SCpnt->device->channel]++; | 1859 | HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)]++; |
1861 | } | 1860 | } |
1862 | 1861 | ||
1863 | break; | 1862 | break; |