Skip to content

Commit f2c1afa

Browse files
Boaz Harroshjejb
authored andcommitted
[SCSI] a2091: 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>
1 parent 7410d84 commit f2c1afa

1 file changed

Lines changed: 5 additions & 31 deletions

File tree

‎drivers/scsi/a2091.c‎

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,9 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
7373
}
7474

7575
if (!dir_in) {
76-
/* copy to bounce buffer for a write */
77-
if (cmd->use_sg)
78-
#if 0
79-
panic ("scsi%ddma: incomplete s/g support",
80-
instance->host_no);
81-
#else
76+
/* copy to bounce buffer for a write */
8277
memcpy (HDATA(instance)->dma_bounce_buffer,
8378
cmd->SCp.ptr, cmd->SCp.this_residual);
84-
#endif
85-
else
86-
memcpy (HDATA(instance)->dma_bounce_buffer,
87-
cmd->request_buffer, cmd->request_bufflen);
8879
}
8980
}
9081

@@ -144,30 +135,13 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
144135

145136
/* copy from a bounce buffer, if necessary */
146137
if (status && HDATA(instance)->dma_bounce_buffer) {
147-
if (SCpnt && SCpnt->use_sg) {
148-
#if 0
149-
panic ("scsi%d: incomplete s/g support",
150-
instance->host_no);
151-
#else
152-
if( HDATA(instance)->dma_dir )
138+
if( HDATA(instance)->dma_dir )
153139
memcpy (SCpnt->SCp.ptr,
154140
HDATA(instance)->dma_bounce_buffer,
155141
SCpnt->SCp.this_residual);
156-
kfree (HDATA(instance)->dma_bounce_buffer);
157-
HDATA(instance)->dma_bounce_buffer = NULL;
158-
HDATA(instance)->dma_bounce_len = 0;
159-
160-
#endif
161-
} else {
162-
if (HDATA(instance)->dma_dir && SCpnt)
163-
memcpy (SCpnt->request_buffer,
164-
HDATA(instance)->dma_bounce_buffer,
165-
SCpnt->request_bufflen);
166-
167-
kfree (HDATA(instance)->dma_bounce_buffer);
168-
HDATA(instance)->dma_bounce_buffer = NULL;
169-
HDATA(instance)->dma_bounce_len = 0;
170-
}
142+
kfree (HDATA(instance)->dma_bounce_buffer);
143+
HDATA(instance)->dma_bounce_buffer = NULL;
144+
HDATA(instance)->dma_bounce_len = 0;
171145
}
172146
}
173147

0 commit comments

Comments
 (0)