From: Gilad Ben-Yossef Date: Thu, 9 Nov 2017 09:16:11 +0000 (+0000) Subject: staging: ccree: simplify AEAD using local var X-Git-Tag: v4.16-rc1~112^2~529 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=d30a396964afdb7f236c476f966cfbd76880e513;p=linux.git 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 Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- 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); }