mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
crypto: ccp - Updates for checkpatch warnings/errors
Changes to address warnings and errors reported by the checkpatch script. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -23,7 +23,6 @@
|
||||
|
||||
#include "ccp-crypto.h"
|
||||
|
||||
|
||||
static int ccp_sha_complete(struct crypto_async_request *async_req, int ret)
|
||||
{
|
||||
struct ahash_request *req = ahash_request_cast(async_req);
|
||||
@@ -37,11 +36,13 @@ static int ccp_sha_complete(struct crypto_async_request *async_req, int ret)
|
||||
if (rctx->hash_rem) {
|
||||
/* Save remaining data to buffer */
|
||||
unsigned int offset = rctx->nbytes - rctx->hash_rem;
|
||||
|
||||
scatterwalk_map_and_copy(rctx->buf, rctx->src,
|
||||
offset, rctx->hash_rem, 0);
|
||||
rctx->buf_count = rctx->hash_rem;
|
||||
} else
|
||||
} else {
|
||||
rctx->buf_count = 0;
|
||||
}
|
||||
|
||||
/* Update result area if supplied */
|
||||
if (req->result)
|
||||
@@ -227,8 +228,9 @@ static int ccp_sha_setkey(struct crypto_ahash *tfm, const u8 *key,
|
||||
}
|
||||
|
||||
key_len = digest_size;
|
||||
} else
|
||||
} else {
|
||||
memcpy(ctx->u.sha.key, key, key_len);
|
||||
}
|
||||
|
||||
for (i = 0; i < block_size; i++) {
|
||||
ctx->u.sha.ipad[i] = ctx->u.sha.key[i] ^ 0x36;
|
||||
@@ -355,7 +357,7 @@ static int ccp_register_hmac_alg(struct list_head *head,
|
||||
ret = crypto_register_ahash(alg);
|
||||
if (ret) {
|
||||
pr_err("%s ahash algorithm registration error (%d)\n",
|
||||
base->cra_name, ret);
|
||||
base->cra_name, ret);
|
||||
kfree(ccp_alg);
|
||||
return ret;
|
||||
}
|
||||
@@ -410,7 +412,7 @@ static int ccp_register_sha_alg(struct list_head *head,
|
||||
ret = crypto_register_ahash(alg);
|
||||
if (ret) {
|
||||
pr_err("%s ahash algorithm registration error (%d)\n",
|
||||
base->cra_name, ret);
|
||||
base->cra_name, ret);
|
||||
kfree(ccp_alg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user