aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_error.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-24 18:05:09 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-10-28 22:10:16 -0400
commit422c0d61d591cbfb70f029e13505fb437e169d68 (patch)
treeebafa14e1c1564ddf263868c3b6907642a8fdf1e /drivers/scsi/scsi_error.c
parent017560fca496f72ed9dd734ffde63ce39dfe0411 (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/scsi_error.c')
-rw-r--r--drivers/scsi/scsi_error.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index f4da56a79ff6..0c5b02d4c7f8 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1033,7 +1033,8 @@ static int scsi_try_bus_reset(struct scsi_cmnd *scmd)
1033 if (!scmd->device->host->hostt->skip_settle_delay) 1033 if (!scmd->device->host->hostt->skip_settle_delay)
1034 ssleep(BUS_RESET_SETTLE_TIME); 1034 ssleep(BUS_RESET_SETTLE_TIME);
1035 spin_lock_irqsave(scmd->device->host->host_lock, flags); 1035 spin_lock_irqsave(scmd->device->host->host_lock, flags);
1036 scsi_report_bus_reset(scmd->device->host, scmd->device->channel); 1036 scsi_report_bus_reset(scmd->device->host,
1037 scmd_channel(scmd));
1037 spin_unlock_irqrestore(scmd->device->host->host_lock, flags); 1038 spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
1038 } 1039 }
1039 1040
@@ -1061,7 +1062,8 @@ static int scsi_try_host_reset(struct scsi_cmnd *scmd)
1061 if (!scmd->device->host->hostt->skip_settle_delay) 1062 if (!scmd->device->host->hostt->skip_settle_delay)
1062 ssleep(HOST_RESET_SETTLE_TIME); 1063 ssleep(HOST_RESET_SETTLE_TIME);
1063 spin_lock_irqsave(scmd->device->host->host_lock, flags); 1064 spin_lock_irqsave(scmd->device->host->host_lock, flags);
1064 scsi_report_bus_reset(scmd->device->host, scmd->device->channel); 1065 scsi_report_bus_reset(scmd->device->host,
1066 scmd_channel(scmd));
1065 spin_unlock_irqrestore(scmd->device->host->host_lock, flags); 1067 spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
1066 } 1068 }
1067 1069
@@ -1091,7 +1093,7 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost,
1091 for (channel = 0; channel <= shost->max_channel; channel++) { 1093 for (channel = 0; channel <= shost->max_channel; channel++) {
1092 chan_scmd = NULL; 1094 chan_scmd = NULL;
1093 list_for_each_entry(scmd, work_q, eh_entry) { 1095 list_for_each_entry(scmd, work_q, eh_entry) {
1094 if (channel == scmd->device->channel) { 1096 if (channel == scmd_channel(scmd)) {
1095 chan_scmd = scmd; 1097 chan_scmd = scmd;
1096 break; 1098 break;
1097 /* 1099 /*
@@ -1109,7 +1111,7 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost,
1109 rtn = scsi_try_bus_reset(chan_scmd); 1111 rtn = scsi_try_bus_reset(chan_scmd);
1110 if (rtn == SUCCESS) { 1112 if (rtn == SUCCESS) {
1111 list_for_each_entry_safe(scmd, next, work_q, eh_entry) { 1113 list_for_each_entry_safe(scmd, next, work_q, eh_entry) {
1112 if (channel == scmd->device->channel) 1114 if (channel == scmd_channel(scmd))
1113 if (!scsi_device_online(scmd->device) || 1115 if (!scsi_device_online(scmd->device) ||
1114 !scsi_eh_tur(scmd)) 1116 !scsi_eh_tur(scmd))
1115 scsi_eh_finish_cmd(scmd, 1117 scsi_eh_finish_cmd(scmd,
@@ -1675,7 +1677,7 @@ void scsi_report_bus_reset(struct Scsi_Host *shost, int channel)
1675 struct scsi_device *sdev; 1677 struct scsi_device *sdev;
1676 1678
1677 __shost_for_each_device(sdev, shost) { 1679 __shost_for_each_device(sdev, shost) {
1678 if (channel == sdev->channel) { 1680 if (channel == sdev_channel(sdev)) {
1679 sdev->was_reset = 1; 1681 sdev->was_reset = 1;
1680 sdev->expecting_cc_ua = 1; 1682 sdev->expecting_cc_ua = 1;
1681 } 1683 }
@@ -1710,8 +1712,8 @@ void scsi_report_device_reset(struct Scsi_Host *shost, int channel, int target)
1710 struct scsi_device *sdev; 1712 struct scsi_device *sdev;
1711 1713
1712 __shost_for_each_device(sdev, shost) { 1714 __shost_for_each_device(sdev, shost) {
1713 if (channel == sdev->channel && 1715 if (channel == sdev_channel(sdev) &&
1714 target == sdev->id) { 1716 target == sdev_id(sdev)) {
1715 sdev->was_reset = 1; 1717 sdev->was_reset = 1;
1716 sdev->expecting_cc_ua = 1; 1718 sdev->expecting_cc_ua = 1;
1717 } 1719 }