diff options
author | Boaz Harrosh <bharrosh@panasas.com> | 2007-09-09 13:59:32 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-11 19:22:35 -0500 |
commit | cc0455fac06f0539277d7b724dbc513284629069 (patch) | |
tree | 7ffb27d55bb508cc02fec80164dea6f86bc90b10 /drivers/scsi | |
parent | f2c1afa5ebc6cd3171539e686b48a2afe24694c0 (diff) |
[SCSI] a3000: convert to accessors and !use_sg cleanup
- convert to accessors and !use_sg cleanup
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/a3000.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c index 796f1c4d772e..d7255c8bf281 100644 --- a/drivers/scsi/a3000.c +++ b/drivers/scsi/a3000.c | |||
@@ -70,12 +70,8 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in) | |||
70 | 70 | ||
71 | if (!dir_in) { | 71 | if (!dir_in) { |
72 | /* copy to bounce buffer for a write */ | 72 | /* copy to bounce buffer for a write */ |
73 | if (cmd->use_sg) { | 73 | memcpy (HDATA(a3000_host)->dma_bounce_buffer, |
74 | memcpy (HDATA(a3000_host)->dma_bounce_buffer, | 74 | cmd->SCp.ptr, cmd->SCp.this_residual); |
75 | cmd->SCp.ptr, cmd->SCp.this_residual); | ||
76 | } else | ||
77 | memcpy (HDATA(a3000_host)->dma_bounce_buffer, | ||
78 | cmd->request_buffer, cmd->request_bufflen); | ||
79 | } | 75 | } |
80 | 76 | ||
81 | addr = virt_to_bus(HDATA(a3000_host)->dma_bounce_buffer); | 77 | addr = virt_to_bus(HDATA(a3000_host)->dma_bounce_buffer); |
@@ -146,7 +142,7 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt, | |||
146 | 142 | ||
147 | /* copy from a bounce buffer, if necessary */ | 143 | /* copy from a bounce buffer, if necessary */ |
148 | if (status && HDATA(instance)->dma_bounce_buffer) { | 144 | if (status && HDATA(instance)->dma_bounce_buffer) { |
149 | if (SCpnt && SCpnt->use_sg) { | 145 | if (SCpnt) { |
150 | if (HDATA(instance)->dma_dir && SCpnt) | 146 | if (HDATA(instance)->dma_dir && SCpnt) |
151 | memcpy (SCpnt->SCp.ptr, | 147 | memcpy (SCpnt->SCp.ptr, |
152 | HDATA(instance)->dma_bounce_buffer, | 148 | HDATA(instance)->dma_bounce_buffer, |
@@ -155,11 +151,6 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt, | |||
155 | HDATA(instance)->dma_bounce_buffer = NULL; | 151 | HDATA(instance)->dma_bounce_buffer = NULL; |
156 | HDATA(instance)->dma_bounce_len = 0; | 152 | HDATA(instance)->dma_bounce_len = 0; |
157 | } else { | 153 | } else { |
158 | if (HDATA(instance)->dma_dir && SCpnt) | ||
159 | memcpy (SCpnt->request_buffer, | ||
160 | HDATA(instance)->dma_bounce_buffer, | ||
161 | SCpnt->request_bufflen); | ||
162 | |||
163 | kfree (HDATA(instance)->dma_bounce_buffer); | 154 | kfree (HDATA(instance)->dma_bounce_buffer); |
164 | HDATA(instance)->dma_bounce_buffer = NULL; | 155 | HDATA(instance)->dma_bounce_buffer = NULL; |
165 | HDATA(instance)->dma_bounce_len = 0; | 156 | HDATA(instance)->dma_bounce_len = 0; |