Re: [PATCH 5/8] staging: ccree: fold common code into function

From: Dan Carpenter
Date: Tue Nov 07 2017 - 05:41:00 EST


On Tue, Nov 07, 2017 at 09:40:01AM +0000, Gilad Ben-Yossef wrote:
> @@ -669,21 +690,12 @@ void cc_unmap_aead_request(struct device *dev, struct aead_request *req)
> }
> if (drvdata->coherent &&
> (areq_ctx->gen_ctx.op_type == DRV_CRYPTO_DIRECTION_DECRYPT) &&
> - likely(req->src == req->dst)) {
> - u32 size_to_skip = req->assoclen;
> -
> - if (areq_ctx->is_gcm4543)
> - size_to_skip += crypto_aead_ivsize(tfm);
> + likely(req->src == req->dst))

Don't remove the curly braces from this one. Multi-line indents get
curly braces for readability.

>
> - /* copy mac to a temporary location to deal with possible
> + /* copy back mac from temporary location to deal with possible
> * data memory overriding that caused by cache coherence problem.
> */
> - cc_copy_sg_portion(dev, areq_ctx->backup_mac, req->src,
> - (size_to_skip + req->cryptlen -
> - areq_ctx->req_authsize),
> - (size_to_skip + req->cryptlen),
> - SSI_SG_FROM_BUF);
> - }
> + cc_copy_mac(dev, req, SSI_SG_FROM_BUF);
> }

regards,
dan carpenter