This just cleans up some of the initializers, and improves the comments
should any other ablkcipher modes be added in the future.  The header
words 1 and 5 have more possibilities than just passing an IV.  These
are pointers to the Cipher Context in/out registers.

Signed-off-by: Martin Hicks <m...@bork.org>
---
 drivers/crypto/talitos.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 226654c..6b2a19a 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -1377,11 +1377,9 @@ static int common_nonsnoop(struct talitos_edesc *edesc,
        int sg_count, ret;
 
        /* first DWORD empty */
-       desc->ptr[0].len = 0;
-       to_talitos_ptr(&desc->ptr[0], 0);
-       desc->ptr[0].j_extent = 0;
+       desc->ptr[0] = zero_entry;
 
-       /* cipher iv */
+       /* cipher context */
        to_talitos_ptr(&desc->ptr[1], edesc->iv_dma);
        desc->ptr[1].len = cpu_to_be16(ivsize);
        desc->ptr[1].j_extent = 0;
@@ -1444,14 +1442,12 @@ static int common_nonsnoop(struct talitos_edesc *edesc,
                                           edesc->dma_len, DMA_BIDIRECTIONAL);
        }
 
-       /* iv out */
+       /* cipher context out */
        map_single_talitos_ptr(dev, &desc->ptr[5], ivsize, ctx->iv, 0,
                               DMA_FROM_DEVICE);
 
        /* last DWORD empty */
-       desc->ptr[6].len = 0;
-       to_talitos_ptr(&desc->ptr[6], 0);
-       desc->ptr[6].j_extent = 0;
+       desc->ptr[6] = zero_entry;
 
        edesc->req.callback = callback;
        edesc->req.context = areq;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to