mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-18 05:06:31 +00:00
iscsi-scst: Micro-optimize cmnd_prepare_recv_pdu()
Instead of adding sg[idx].offset to addr and immediately subtracting sg[idx].offset again, leave out both arithmetic operations. Signed-off-by: Bart Van Assche <bvanassche@acm.org> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5735 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1562,11 +1562,11 @@ static int cmnd_prepare_recv_pdu(struct iscsi_conn *conn,
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
addr = (char __force __user *)(sg_virt(&sg[idx]));
|
||||
addr = (char __force __user *)(page_address(sg_page(&sg[idx])));
|
||||
EXTRACHECKS_BUG_ON(addr == NULL);
|
||||
sg_len = sg[idx].offset + sg[idx].length - offset;
|
||||
|
||||
conn->read_iov[i].iov_base = addr + offset - sg[idx].offset;
|
||||
conn->read_iov[i].iov_base = addr + offset;
|
||||
|
||||
if (size <= sg_len) {
|
||||
TRACE_DBG("idx=%d, i=%d, offset=%u, size=%d, addr=%p",
|
||||
|
||||
Reference in New Issue
Block a user