Skip to content

Commit 5676470

Browse files
committed
async_pq: kill a stray dma_map() call and other cleanups
- update the kernel doc for async_syndrome to indicate what NULL in the source list means - whitespace fixups Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 6629542 commit 5676470

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎crypto/async_tx/async_pq.c‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,14 @@ do_sync_gen_syndrome(struct page **blocks, unsigned int offset, int disks,
181181
* blocks[disks-1] to NULL. When P or Q is omitted 'len' must be <=
182182
* PAGE_SIZE as a temporary buffer of this size is used in the
183183
* synchronous path. 'disks' always accounts for both destination
184-
* buffers.
184+
* buffers. If any source buffers (blocks[i] where i < disks - 2) are
185+
* set to NULL those buffers will be replaced with the raid6_zero_page
186+
* in the synchronous path and omitted in the hardware-asynchronous
187+
* path.
185188
*
186189
* 'blocks' note: if submit->scribble is NULL then the contents of
187-
* 'blocks' may be overridden
190+
* 'blocks' may be overwritten to perform address conversions
191+
* (dma_map_page() or page_address()).
188192
*/
189193
struct dma_async_tx_descriptor *
190194
async_gen_syndrome(struct page **blocks, unsigned int offset, int disks,
@@ -283,13 +287,13 @@ async_syndrome_val(struct page **blocks, unsigned int offset, int disks,
283287
if (!P(blocks, disks))
284288
dma_flags |= DMA_PREP_PQ_DISABLE_P;
285289
else
286-
pq[0] = dma_map_page(dev, P(blocks,disks),
290+
pq[0] = dma_map_page(dev, P(blocks, disks),
287291
offset, len,
288292
DMA_TO_DEVICE);
289293
if (!Q(blocks, disks))
290294
dma_flags |= DMA_PREP_PQ_DISABLE_Q;
291295
else
292-
pq[1] = dma_map_page(dev, Q(blocks,disks),
296+
pq[1] = dma_map_page(dev, Q(blocks, disks),
293297
offset, len,
294298
DMA_TO_DEVICE);
295299

@@ -303,9 +307,6 @@ async_syndrome_val(struct page **blocks, unsigned int offset, int disks,
303307
coefs[src_cnt] = raid6_gfexp[i];
304308
src_cnt++;
305309
}
306-
pq[1] = dma_map_page(dev, Q(blocks,disks),
307-
offset, len,
308-
DMA_TO_DEVICE);
309310

310311
for (;;) {
311312
tx = device->device_prep_dma_pq_val(chan, pq, dma_src,

0 commit comments

Comments
 (0)