diff options
author | Gilad Ben-Yossef <gilad@benyossef.com> | 2017-11-09 12:16:11 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-27 11:20:38 +0300 |
commit | d30a396964afdb7f236c476f966cfbd76880e513 (patch) | |
tree | 7d781a3aaa1f25960f30659954985df5f83e6945 /drivers/staging/ccree | |
parent | e1cb54fd3721d4dfcfe82dc4f48c1d69433cc7f1 (diff) | |
download | linux-d30a396964afdb7f236c476f966cfbd76880e513.tar.xz |
staging: ccree: simplify AEAD using local var
Make the code more readable by using a local variable
for commonly use expression in the AEAD part of the driver.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ccree')
-rw-r--r-- | drivers/staging/ccree/ssi_aead.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c index 0b5b23036961..a8e1371772a3 100644 --- a/drivers/staging/ccree/ssi_aead.c +++ b/drivers/staging/ccree/ssi_aead.c @@ -251,13 +251,11 @@ static void ssi_aead_complete(struct device *dev, void *ssi_req, void __iomem *c } } else { /*ENCRYPT*/ if (unlikely(areq_ctx->is_icv_fragmented)) { + u32 skip = areq->cryptlen + areq_ctx->dst_offset; + cc_copy_sg_portion(dev, areq_ctx->mac_buf, - areq_ctx->dst_sgl, - (areq->cryptlen + - areq_ctx->dst_offset), - (areq->cryptlen + - areq_ctx->dst_offset + - ctx->authsize), + areq_ctx->dst_sgl, skip, + (skip + ctx->authsize), SSI_SG_FROM_BUF); } |