aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic7xxx
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/aic7xxx
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/aic7xxx')
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.c11
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.c10
2 files changed, 11 insertions, 10 deletions
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 5e023dca4e52..cfb46c241b38 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -398,7 +398,7 @@ ahd_linux_unmap_scb(struct ahd_softc *ahd, struct scb *scb)
398 398
399/******************************** Macros **************************************/ 399/******************************** Macros **************************************/
400#define BUILD_SCSIID(ahd, cmd) \ 400#define BUILD_SCSIID(ahd, cmd) \
401 ((((cmd)->device->id << TID_SHIFT) & TID) | (ahd)->our_id) 401 (((scmd_id(cmd) << TID_SHIFT) & TID) | (ahd)->our_id)
402 402
403/* 403/*
404 * Return a string describing the driver. 404 * Return a string describing the driver.
@@ -685,7 +685,7 @@ ahd_linux_bus_reset(struct scsi_cmnd *cmd)
685 ahd_name(ahd), cmd); 685 ahd_name(ahd), cmd);
686#endif 686#endif
687 ahd_lock(ahd, &s); 687 ahd_lock(ahd, &s);
688 found = ahd_reset_channel(ahd, cmd->device->channel + 'A', 688 found = ahd_reset_channel(ahd, scmd_channel(cmd) + 'A',
689 /*initiate reset*/TRUE); 689 /*initiate reset*/TRUE);
690 ahd_unlock(ahd, &s); 690 ahd_unlock(ahd, &s);
691 691
@@ -2110,8 +2110,9 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2110 2110
2111 /* Any SCB for this device will do for a target reset */ 2111 /* Any SCB for this device will do for a target reset */
2112 LIST_FOREACH(pending_scb, &ahd->pending_scbs, pending_links) { 2112 LIST_FOREACH(pending_scb, &ahd->pending_scbs, pending_links) {
2113 if (ahd_match_scb(ahd, pending_scb, cmd->device->id, 2113 if (ahd_match_scb(ahd, pending_scb,
2114 cmd->device->channel + 'A', 2114 scmd_id(cmd),
2115 scmd_channel(cmd) + 'A',
2115 CAM_LUN_WILDCARD, 2116 CAM_LUN_WILDCARD,
2116 SCB_LIST_NULL, ROLE_INITIATOR) == 0) 2117 SCB_LIST_NULL, ROLE_INITIATOR) == 0)
2117 break; 2118 break;
@@ -2198,7 +2199,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2198 if (last_phase != P_BUSFREE 2199 if (last_phase != P_BUSFREE
2199 && (SCB_GET_TAG(pending_scb) == active_scbptr 2200 && (SCB_GET_TAG(pending_scb) == active_scbptr
2200 || (flag == SCB_DEVICE_RESET 2201 || (flag == SCB_DEVICE_RESET
2201 && SCSIID_TARGET(ahd, saved_scsiid) == cmd->device->id))) { 2202 && SCSIID_TARGET(ahd, saved_scsiid) == scmd_id(cmd)))) {
2202 2203
2203 /* 2204 /*
2204 * We're active on the bus, so assert ATN 2205 * We're active on the bus, so assert ATN
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index 7074ab95d1cc..1861407422e4 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -686,7 +686,7 @@ ahc_linux_biosparam(struct scsi_device *sdev, struct block_device *bdev,
686 u_int channel; 686 u_int channel;
687 687
688 ahc = *((struct ahc_softc **)sdev->host->hostdata); 688 ahc = *((struct ahc_softc **)sdev->host->hostdata);
689 channel = sdev->channel; 689 channel = sdev_channel(sdev);
690 690
691 bh = scsi_bios_ptable(bdev); 691 bh = scsi_bios_ptable(bdev);
692 if (bh) { 692 if (bh) {
@@ -759,7 +759,7 @@ ahc_linux_bus_reset(struct scsi_cmnd *cmd)
759 ahc = *(struct ahc_softc **)cmd->device->host->hostdata; 759 ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
760 760
761 ahc_lock(ahc, &flags); 761 ahc_lock(ahc, &flags);
762 found = ahc_reset_channel(ahc, cmd->device->channel + 'A', 762 found = ahc_reset_channel(ahc, scmd_channel(cmd) + 'A',
763 /*initiate reset*/TRUE); 763 /*initiate reset*/TRUE);
764 ahc_unlock(ahc, &flags); 764 ahc_unlock(ahc, &flags);
765 765
@@ -2172,8 +2172,8 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2172 2172
2173 /* Any SCB for this device will do for a target reset */ 2173 /* Any SCB for this device will do for a target reset */
2174 LIST_FOREACH(pending_scb, &ahc->pending_scbs, pending_links) { 2174 LIST_FOREACH(pending_scb, &ahc->pending_scbs, pending_links) {
2175 if (ahc_match_scb(ahc, pending_scb, cmd->device->id, 2175 if (ahc_match_scb(ahc, pending_scb, scmd_id(cmd),
2176 cmd->device->channel + 'A', 2176 scmd_channel(cmd) + 'A',
2177 CAM_LUN_WILDCARD, 2177 CAM_LUN_WILDCARD,
2178 SCB_LIST_NULL, ROLE_INITIATOR) == 0) 2178 SCB_LIST_NULL, ROLE_INITIATOR) == 0)
2179 break; 2179 break;
@@ -2260,7 +2260,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2260 if (last_phase != P_BUSFREE 2260 if (last_phase != P_BUSFREE
2261 && (pending_scb->hscb->tag == active_scb_index 2261 && (pending_scb->hscb->tag == active_scb_index
2262 || (flag == SCB_DEVICE_RESET 2262 || (flag == SCB_DEVICE_RESET
2263 && SCSIID_TARGET(ahc, saved_scsiid) == cmd->device->id))) { 2263 && SCSIID_TARGET(ahc, saved_scsiid) == scmd_id(cmd)))) {
2264 2264
2265 /* 2265 /*
2266 * We're active on the bus, so assert ATN 2266 * We're active on the bus, so assert ATN