crypto: chcr - Replace _manual_ swap with swap macro

Make use of the swap macro and remove unnecessary variable temp.
This makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Gustavo A. R. Silva 2017-11-03 11:58:23 -05:00 committed by Herbert Xu
parent 9c90344648
commit abfa2b377f
1 changed files with 1 additions and 4 deletions

View File

@ -1634,11 +1634,8 @@ static int chcr_ahash_update(struct ahash_request *req)
}
if (remainder) {
u8 *temp;
/* Swap buffers */
temp = req_ctx->reqbfr;
req_ctx->reqbfr = req_ctx->skbfr;
req_ctx->skbfr = temp;
swap(req_ctx->reqbfr, req_ctx->skbfr);
sg_pcopy_to_buffer(req->src, sg_nents(req->src),
req_ctx->reqbfr, remainder, req->nbytes -
remainder);