summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/3w-xxxx.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-03-09 05:44:36 +0100
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-07 19:15:46 +0200
commite943752ecf0ce41cdf949d565140d91c7711dfd9 (patch)
treef4c3b4326578d2600a5328a127da13224be6670e /drivers/scsi/3w-xxxx.c
parent[SCSI] stex: use sg buffer copy helper functions (diff)
downloadlinux-e943752ecf0ce41cdf949d565140d91c7711dfd9.tar.xz
linux-e943752ecf0ce41cdf949d565140d91c7711dfd9.zip
[SCSI] 3w-xxxx: use sg buffer copy helper functions
This rewrites tw_transfer_internal with scsi_sg_copy_from/to_buffer. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Adam Radford <linuxraid@amcc.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/3w-xxxx.c')
-rw-r--r--drivers/scsi/3w-xxxx.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index d09532162217..a2fc06022e10 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -1463,18 +1463,10 @@ static void tw_transfer_internal(TW_Device_Extension *tw_dev, int request_id,
void *data, unsigned int len)
{
struct scsi_cmnd *cmd = tw_dev->srb[request_id];
- void *buf;
- unsigned int transfer_len;
- unsigned long flags = 0;
- struct scatterlist *sg = scsi_sglist(cmd);
+ unsigned long flags;
local_irq_save(flags);
- buf = kmap_atomic(sg_page(sg), KM_IRQ0) + sg->offset;
- transfer_len = min(sg->length, len);
-
- memcpy(buf, data, transfer_len);
-
- kunmap_atomic(buf - sg->offset, KM_IRQ0);
+ scsi_sg_copy_from_buffer(cmd, data, len);
local_irq_restore(flags);
}