diff options
author | Gustavo A. R. Silva <garsilva@embeddedor.com> | 2017-11-03 11:58:23 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-11-06 14:45:35 +0800 |
commit | abfa2b377f752a13e6caaa8c6c4add6ab9b71ba8 (patch) | |
tree | 75ba237b102727776f9a86dd607913323b2b1d7f /drivers/crypto | |
parent | 9c9034464860707669e91ce367c9eeb65e4175cd (diff) |
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>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/chelsio/chcr_algo.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c index 9d298c681abe..4eed7171e2ae 100644 --- a/drivers/crypto/chelsio/chcr_algo.c +++ b/drivers/crypto/chelsio/chcr_algo.c @@ -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); |