aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/atp870u.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/atp870u.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/atp870u.c')
-rw-r--r--drivers/scsi/atp870u.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c
index b150bd8e254a..5227a779c05c 100644
--- a/drivers/scsi/atp870u.c
+++ b/drivers/scsi/atp870u.c
@@ -621,10 +621,10 @@ static int atp870u_queuecommand(struct scsi_cmnd * req_p,
621 struct atp_unit *dev; 621 struct atp_unit *dev;
622 struct Scsi_Host *host; 622 struct Scsi_Host *host;
623 623
624 c = req_p->device->channel; 624 c = scmd_channel(req_p);
625 req_p->sense_buffer[0]=0; 625 req_p->sense_buffer[0]=0;
626 req_p->resid = 0; 626 req_p->resid = 0;
627 if (req_p->device->channel > 1) { 627 if (scmd_channel(req_p) > 1) {
628 req_p->result = 0x00040000; 628 req_p->result = 0x00040000;
629 done(req_p); 629 done(req_p);
630#ifdef ED_DBGP 630#ifdef ED_DBGP
@@ -639,7 +639,7 @@ static int atp870u_queuecommand(struct scsi_cmnd * req_p,
639 639
640 640
641 m = 1; 641 m = 1;
642 m = m << req_p->device->id; 642 m = m << scmd_id(req_p);
643 643
644 /* 644 /*
645 * Fake a timeout for missing targets 645 * Fake a timeout for missing targets
@@ -757,9 +757,9 @@ static void send_s870(struct atp_unit *dev,unsigned char c)
757 dev->quhd[c] = 0; 757 dev->quhd[c] = 0;
758 } 758 }
759 workreq = dev->quereq[c][dev->quhd[c]]; 759 workreq = dev->quereq[c][dev->quhd[c]];
760 if (dev->id[c][workreq->device->id].curr_req == 0) { 760 if (dev->id[c][scmd_id(workreq)].curr_req == 0) {
761 dev->id[c][workreq->device->id].curr_req = workreq; 761 dev->id[c][scmd_id(workreq)].curr_req = workreq;
762 dev->last_cmd[c] = workreq->device->id; 762 dev->last_cmd[c] = scmd_id(workreq);
763 goto cmd_subp; 763 goto cmd_subp;
764 } 764 }
765 dev->quhd[c] = j; 765 dev->quhd[c] = j;
@@ -786,16 +786,16 @@ abortsnd:
786oktosend: 786oktosend:
787#ifdef ED_DBGP 787#ifdef ED_DBGP
788 printk("OK to Send\n"); 788 printk("OK to Send\n");
789 printk("CDB"); 789 scmd_printk(KERN_DEBUG, workreq, "CDB");
790 for(i=0;i<workreq->cmd_len;i++) { 790 for(i=0;i<workreq->cmd_len;i++) {
791 printk(" %x",workreq->cmnd[i]); 791 printk(" %x",workreq->cmnd[i]);
792 } 792 }
793 printk("\nChannel = %d ID = %d LUN = %d\n",c,workreq->device->id,workreq->device->lun); 793 printk("\n");
794#endif 794#endif
795 if (dev->dev_id == ATP885_DEVID) { 795 if (dev->dev_id == ATP885_DEVID) {
796 j = inb(dev->baseport + 0x29) & 0xfe; 796 j = inb(dev->baseport + 0x29) & 0xfe;
797 outb(j, dev->baseport + 0x29); 797 outb(j, dev->baseport + 0x29);
798 dev->r1f[c][workreq->device->id] = 0; 798 dev->r1f[c][scmd_id(workreq)] = 0;
799 } 799 }
800 800
801 if (workreq->cmnd[0] == READ_CAPACITY) { 801 if (workreq->cmnd[0] == READ_CAPACITY) {
@@ -809,7 +809,7 @@ oktosend:
809 809
810 tmport = workport + 0x1b; 810 tmport = workport + 0x1b;
811 j = 0; 811 j = 0;
812 target_id = workreq->device->id; 812 target_id = scmd_id(workreq);
813 813
814 /* 814 /*
815 * Wide ? 815 * Wide ?
@@ -3108,7 +3108,7 @@ static int atp870u_abort(struct scsi_cmnd * SCpnt)
3108 host = SCpnt->device->host; 3108 host = SCpnt->device->host;
3109 3109
3110 dev = (struct atp_unit *)&host->hostdata; 3110 dev = (struct atp_unit *)&host->hostdata;
3111 c=SCpnt->device->channel; 3111 c = scmd_channel(SCpnt);
3112 printk(" atp870u: abort Channel = %x \n", c); 3112 printk(" atp870u: abort Channel = %x \n", c);
3113 printk("working=%x last_cmd=%x ", dev->working[c], dev->last_cmd[c]); 3113 printk("working=%x last_cmd=%x ", dev->working[c], dev->last_cmd[c]);
3114 printk(" quhdu=%x quendu=%x ", dev->quhd[c], dev->quend[c]); 3114 printk(" quhdu=%x quendu=%x ", dev->quhd[c], dev->quend[c]);