aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/NCR53C9x.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/NCR53C9x.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/NCR53C9x.c')
-rw-r--r--drivers/scsi/NCR53C9x.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c
index 6ceabbd42a3d..26146a4b67b8 100644
--- a/drivers/scsi/NCR53C9x.c
+++ b/drivers/scsi/NCR53C9x.c
@@ -936,7 +936,7 @@ static void esp_release_dmabufs(struct NCR_ESP *esp, Scsi_Cmnd *sp)
936 936
937static void esp_restore_pointers(struct NCR_ESP *esp, Scsi_Cmnd *sp) 937static void esp_restore_pointers(struct NCR_ESP *esp, Scsi_Cmnd *sp)
938{ 938{
939 struct esp_pointers *ep = &esp->data_pointers[sp->device->id]; 939 struct esp_pointers *ep = &esp->data_pointers[scmd_id(sp)];
940 940
941 sp->SCp.ptr = ep->saved_ptr; 941 sp->SCp.ptr = ep->saved_ptr;
942 sp->SCp.buffer = ep->saved_buffer; 942 sp->SCp.buffer = ep->saved_buffer;
@@ -946,7 +946,7 @@ static void esp_restore_pointers(struct NCR_ESP *esp, Scsi_Cmnd *sp)
946 946
947static void esp_save_pointers(struct NCR_ESP *esp, Scsi_Cmnd *sp) 947static void esp_save_pointers(struct NCR_ESP *esp, Scsi_Cmnd *sp)
948{ 948{
949 struct esp_pointers *ep = &esp->data_pointers[sp->device->id]; 949 struct esp_pointers *ep = &esp->data_pointers[scmd_id(sp)];
950 950
951 ep->saved_ptr = sp->SCp.ptr; 951 ep->saved_ptr = sp->SCp.ptr;
952 ep->saved_buffer = sp->SCp.buffer; 952 ep->saved_buffer = sp->SCp.buffer;
@@ -1693,13 +1693,13 @@ static inline void esp_connect(struct NCR_ESP *esp, struct ESP_regs *eregs,
1693 if(esp->prev_soff != esp_dev->sync_max_offset || 1693 if(esp->prev_soff != esp_dev->sync_max_offset ||
1694 esp->prev_stp != esp_dev->sync_min_period || 1694 esp->prev_stp != esp_dev->sync_min_period ||
1695 (esp->erev > esp100a && 1695 (esp->erev > esp100a &&
1696 esp->prev_cfg3 != esp->config3[sp->device->id])) { 1696 esp->prev_cfg3 != esp->config3[scmd_id(sp)])) {
1697 esp->prev_soff = esp_dev->sync_max_offset; 1697 esp->prev_soff = esp_dev->sync_max_offset;
1698 esp_write(eregs->esp_soff, esp->prev_soff); 1698 esp_write(eregs->esp_soff, esp->prev_soff);
1699 esp->prev_stp = esp_dev->sync_min_period; 1699 esp->prev_stp = esp_dev->sync_min_period;
1700 esp_write(eregs->esp_stp, esp->prev_stp); 1700 esp_write(eregs->esp_stp, esp->prev_stp);
1701 if(esp->erev > esp100a) { 1701 if(esp->erev > esp100a) {
1702 esp->prev_cfg3 = esp->config3[sp->device->id]; 1702 esp->prev_cfg3 = esp->config3[scmd_id(sp)];
1703 esp_write(eregs->esp_cfg3, esp->prev_cfg3); 1703 esp_write(eregs->esp_cfg3, esp->prev_cfg3);
1704 } 1704 }
1705 } 1705 }
@@ -2205,7 +2205,7 @@ static int esp_do_freebus(struct NCR_ESP *esp, struct ESP_regs *eregs)
2205 2205
2206 if(SCptr->SCp.Status != GOOD && 2206 if(SCptr->SCp.Status != GOOD &&
2207 SCptr->SCp.Status != CONDITION_GOOD && 2207 SCptr->SCp.Status != CONDITION_GOOD &&
2208 ((1<<SCptr->device->id) & esp->targets_present) && 2208 ((1<<scmd_id(SCptr)) & esp->targets_present) &&
2209 esp_dev->sync && esp_dev->sync_max_offset) { 2209 esp_dev->sync && esp_dev->sync_max_offset) {
2210 /* SCSI standard says that the synchronous capabilities 2210 /* SCSI standard says that the synchronous capabilities
2211 * should be renegotiated at this point. Most likely 2211 * should be renegotiated at this point. Most likely
@@ -2597,7 +2597,7 @@ static int esp_select_complete(struct NCR_ESP *esp, struct ESP_regs *eregs)
2597 */ 2597 */
2598 if(esp->ireg == (ESP_INTR_FDONE | ESP_INTR_BSERV)) { 2598 if(esp->ireg == (ESP_INTR_FDONE | ESP_INTR_BSERV)) {
2599 /* target speaks... */ 2599 /* target speaks... */
2600 esp->targets_present |= (1<<SCptr->device->id); 2600 esp->targets_present |= (1<<scmd_id(SCptr));
2601 2601
2602 /* What if the target ignores the sdtr? */ 2602 /* What if the target ignores the sdtr? */
2603 if(esp->snip) 2603 if(esp->snip)
@@ -3064,7 +3064,7 @@ static int check_multibyte_msg(struct NCR_ESP *esp,
3064 ESPSDTR(("soff=%2x stp=%2x cfg3=%2x\n", 3064 ESPSDTR(("soff=%2x stp=%2x cfg3=%2x\n",
3065 esp_dev->sync_max_offset, 3065 esp_dev->sync_max_offset,
3066 esp_dev->sync_min_period, 3066 esp_dev->sync_min_period,
3067 esp->config3[SCptr->device->id])); 3067 esp->config3[scmd_id(SCptr)]));
3068 3068
3069 esp->snip = 0; 3069 esp->snip = 0;
3070 } else if(esp_dev->sync_max_offset) { 3070 } else if(esp_dev->sync_max_offset) {
@@ -3621,7 +3621,7 @@ void esp_slave_destroy(Scsi_Device *SDptr)
3621{ 3621{
3622 struct NCR_ESP *esp = (struct NCR_ESP *) SDptr->host->hostdata; 3622 struct NCR_ESP *esp = (struct NCR_ESP *) SDptr->host->hostdata;
3623 3623
3624 esp->targets_present &= ~(1 << SDptr->id); 3624 esp->targets_present &= ~(1 << sdev_id(SDptr));
3625 kfree(SDptr->hostdata); 3625 kfree(SDptr->hostdata);
3626 SDptr->hostdata = NULL; 3626 SDptr->hostdata = NULL;
3627} 3627}