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:
Vladislav Bolkhovitin
2014-08-27 02:55:28 +00:00
parent 760b71423a
commit 9c2fb52429
+2 -2
View File
@@ -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",