Commit e943752e authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by James Bottomley

[SCSI] 3w-xxxx: use sg buffer copy helper functions

This rewrites tw_transfer_internal with scsi_sg_copy_from/to_buffer.
Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Adam Radford <linuxraid@amcc.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 31fe47d4
...@@ -1463,18 +1463,10 @@ static void tw_transfer_internal(TW_Device_Extension *tw_dev, int request_id, ...@@ -1463,18 +1463,10 @@ static void tw_transfer_internal(TW_Device_Extension *tw_dev, int request_id,
void *data, unsigned int len) void *data, unsigned int len)
{ {
struct scsi_cmnd *cmd = tw_dev->srb[request_id]; struct scsi_cmnd *cmd = tw_dev->srb[request_id];
void *buf; unsigned long flags;
unsigned int transfer_len;
unsigned long flags = 0;
struct scatterlist *sg = scsi_sglist(cmd);
local_irq_save(flags); local_irq_save(flags);
buf = kmap_atomic(sg_page(sg), KM_IRQ0) + sg->offset; scsi_sg_copy_from_buffer(cmd, data, len);
transfer_len = min(sg->length, len);
memcpy(buf, data, transfer_len);
kunmap_atomic(buf - sg->offset, KM_IRQ0);
local_irq_restore(flags); local_irq_restore(flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment