aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/async_tx/async_memcpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/async_tx/async_memcpy.c')
-rw-r--r--crypto/async_tx/async_memcpy.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/crypto/async_tx/async_memcpy.c b/crypto/async_tx/async_memcpy.c
index a973f4ef897d..047e533fcc5b 100644
--- a/crypto/async_tx/async_memcpy.c
+++ b/crypto/async_tx/async_memcpy.c
@@ -36,7 +36,6 @@
36 * @offset: offset in pages to start transaction 36 * @offset: offset in pages to start transaction
37 * @len: length in bytes 37 * @len: length in bytes
38 * @flags: ASYNC_TX_ASSUME_COHERENT, ASYNC_TX_ACK, ASYNC_TX_DEP_ACK, 38 * @flags: ASYNC_TX_ASSUME_COHERENT, ASYNC_TX_ACK, ASYNC_TX_DEP_ACK,
39 * ASYNC_TX_KMAP_SRC, ASYNC_TX_KMAP_DST
40 * @depend_tx: memcpy depends on the result of this transaction 39 * @depend_tx: memcpy depends on the result of this transaction
41 * @cb_fn: function to call when the memcpy completes 40 * @cb_fn: function to call when the memcpy completes
42 * @cb_param: parameter to pass to the callback routine 41 * @cb_param: parameter to pass to the callback routine
@@ -88,23 +87,13 @@ async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset,
88 __FUNCTION__); 87 __FUNCTION__);
89 } 88 }
90 89
91 if (flags & ASYNC_TX_KMAP_DST) 90 dest_buf = kmap_atomic(dest, KM_USER0) + dest_offset;
92 dest_buf = kmap_atomic(dest, KM_USER0) + dest_offset; 91 src_buf = kmap_atomic(src, KM_USER1) + src_offset;
93 else
94 dest_buf = page_address(dest) + dest_offset;
95
96 if (flags & ASYNC_TX_KMAP_SRC)
97 src_buf = kmap_atomic(src, KM_USER0) + src_offset;
98 else
99 src_buf = page_address(src) + src_offset;
100 92
101 memcpy(dest_buf, src_buf, len); 93 memcpy(dest_buf, src_buf, len);
102 94
103 if (flags & ASYNC_TX_KMAP_DST) 95 kunmap_atomic(dest_buf, KM_USER0);
104 kunmap_atomic(dest_buf, KM_USER0); 96 kunmap_atomic(src_buf, KM_USER1);
105
106 if (flags & ASYNC_TX_KMAP_SRC)
107 kunmap_atomic(src_buf, KM_USER0);
108 97
109 async_tx_sync_epilog(flags, depend_tx, cb_fn, cb_param); 98 async_tx_sync_epilog(flags, depend_tx, cb_fn, cb_param);
110 } 99 }