Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8db88467 authored by Tom Lendacky's avatar Tom Lendacky Committed by Herbert Xu
Browse files

crypto: ccp - Updates for checkpatch warnings/errors



Changes to address warnings and errors reported by the checkpatch
script.

Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 2ecc1e95
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@

#include "ccp-crypto.h"


static int ccp_aes_cmac_complete(struct crypto_async_request *async_req,
				 int ret)
{
@@ -38,11 +37,13 @@ static int ccp_aes_cmac_complete(struct crypto_async_request *async_req,
	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)
@@ -292,7 +293,8 @@ static int ccp_aes_cmac_cra_init(struct crypto_tfm *tfm)
	crypto_ahash_set_reqsize(ahash, sizeof(struct ccp_aes_cmac_req_ctx));

	cipher_tfm = crypto_alloc_cipher("aes", 0,
			CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK);
					 CRYPTO_ALG_ASYNC |
					 CRYPTO_ALG_NEED_FALLBACK);
	if (IS_ERR(cipher_tfm)) {
		pr_warn("could not load aes cipher driver\n");
		return PTR_ERR(cipher_tfm);
+1 −3
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@

#include "ccp-crypto.h"


struct ccp_aes_xts_def {
	const char *name;
	const char *drv_name;
@@ -216,7 +215,6 @@ static void ccp_aes_xts_cra_exit(struct crypto_tfm *tfm)
	ctx->u.aes.tfm_ablkcipher = NULL;
}


static int ccp_register_aes_xts_alg(struct list_head *head,
				    const struct ccp_aes_xts_def *def)
{
+1 −2
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@

#include "ccp-crypto.h"


static int ccp_aes_complete(struct crypto_async_request *async_req, int ret)
{
	struct ablkcipher_request *req = ablkcipher_request_cast(async_req);
+2 −3
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ static unsigned int sha_disable;
module_param(sha_disable, uint, 0444);
MODULE_PARM_DESC(sha_disable, "Disable use of SHA - any non-zero value");


/* List heads for the supported algorithms */
static LIST_HEAD(hash_algs);
static LIST_HEAD(cipher_algs);
@@ -48,6 +47,7 @@ struct ccp_crypto_queue {
	struct list_head *backlog;
	unsigned int cmd_count;
};

#define CCP_CRYPTO_MAX_QLEN	100

static struct ccp_crypto_queue req_queue;
@@ -77,7 +77,6 @@ struct ccp_crypto_cpu {
	int err;
};


static inline bool ccp_crypto_success(int err)
{
	if (err && (err != -EINPROGRESS) && (err != -EBUSY))
@@ -143,7 +142,7 @@ static void ccp_crypto_complete(void *data, int err)
	int ret;

	if (err == -EINPROGRESS) {
		/* Only propogate the -EINPROGRESS if necessary */
		/* Only propagate the -EINPROGRESS if necessary */
		if (crypto_cmd->ret == -EBUSY) {
			crypto_cmd->ret = -EINPROGRESS;
			req->complete(req, -EINPROGRESS);
+7 −5
Original line number Diff line number Diff line
@@ -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;
Loading