mirror of https://gitee.com/openkylin/linux.git
[SCSI] aacraid: optimize sg alloc
Received From Mark Salyzyn Slight space and speed efficiency improvement. Signed-off-by: Mark Haverkamp <markh@osdl.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
parent
edb527ce35
commit
3c1e0cca94
|
@ -2218,15 +2218,15 @@ static unsigned long aac_build_sg(struct scsi_cmnd* scsicmd, struct sgmap* psg)
|
|||
}
|
||||
}
|
||||
else if(scsicmd->request_bufflen) {
|
||||
dma_addr_t addr;
|
||||
addr = pci_map_single(dev->pdev,
|
||||
u32 addr;
|
||||
scsicmd->SCp.dma_handle = pci_map_single(dev->pdev,
|
||||
scsicmd->request_buffer,
|
||||
scsicmd->request_bufflen,
|
||||
scsicmd->sc_data_direction);
|
||||
addr = scsicmd->SCp.dma_handle;
|
||||
psg->count = cpu_to_le32(1);
|
||||
psg->sg[0].addr = cpu_to_le32(addr);
|
||||
psg->sg[0].count = cpu_to_le32(scsicmd->request_bufflen);
|
||||
scsicmd->SCp.dma_handle = addr;
|
||||
byte_count = scsicmd->request_bufflen;
|
||||
}
|
||||
return byte_count;
|
||||
|
|
Loading…
Reference in New Issue