crypto: chcr - Replace _manual_ swap with swap macro
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- drivers/crypto/chelsio/chcr_algo.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/crypto/chelsio/chcr_algo.c +1 -4
@@ -1469,11 +1469,8 @@ static int chcr_ahash_update(struct ahash_request *req)return -ENOMEM ;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);
Signature · 1 line
2.7.4
Herbert Xu
maintainerQuoted 6 lines · Gustavo A. R. Silva
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 <[email protected]>
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt