提交 abfa2b37 编写于 作者: G Gustavo A. R. Silva 提交者: Herbert Xu

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: NGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 9c903446
...@@ -1634,11 +1634,8 @@ static int chcr_ahash_update(struct ahash_request *req) ...@@ -1634,11 +1634,8 @@ static int chcr_ahash_update(struct ahash_request *req)
} }
if (remainder) { if (remainder) {
u8 *temp;
/* Swap buffers */ /* Swap buffers */
temp = req_ctx->reqbfr; swap(req_ctx->reqbfr, req_ctx->skbfr);
req_ctx->reqbfr = req_ctx->skbfr;
req_ctx->skbfr = temp;
sg_pcopy_to_buffer(req->src, sg_nents(req->src), sg_pcopy_to_buffer(req->src, sg_nents(req->src),
req_ctx->reqbfr, remainder, req->nbytes - req_ctx->reqbfr, remainder, req->nbytes -
remainder); remainder);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册