提交 d8660160 编写于 作者: G Gilad Ben-Yossef 提交者: Greg Kroah-Hartman

staging: ccree: rename func for readability

Rename the insanely long ssi_ahash_get_larval_digest_sram_addr() func
to cc_larval_digest_addr() for better code readability
Signed-off-by: NGilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 896d236f
...@@ -336,8 +336,8 @@ static int hmac_setkey(struct cc_hw_desc *desc, struct ssi_aead_ctx *ctx) ...@@ -336,8 +336,8 @@ static int hmac_setkey(struct cc_hw_desc *desc, struct ssi_aead_ctx *ctx)
hw_desc_init(&desc[idx]); hw_desc_init(&desc[idx]);
set_cipher_mode(&desc[idx], hash_mode); set_cipher_mode(&desc[idx], hash_mode);
set_din_sram(&desc[idx], set_din_sram(&desc[idx],
ssi_ahash_get_larval_digest_sram_addr( cc_larval_digest_addr(ctx->drvdata,
ctx->drvdata, ctx->auth_mode), ctx->auth_mode),
digest_size); digest_size);
set_flow_mode(&desc[idx], S_DIN_to_HASH); set_flow_mode(&desc[idx], S_DIN_to_HASH);
set_setup_mode(&desc[idx], SETUP_LOAD_STATE0); set_setup_mode(&desc[idx], SETUP_LOAD_STATE0);
...@@ -441,8 +441,7 @@ ssi_get_plain_hmac_key(struct crypto_aead *tfm, const u8 *key, ...@@ -441,8 +441,7 @@ ssi_get_plain_hmac_key(struct crypto_aead *tfm, const u8 *key,
dma_addr_t key_dma_addr = 0; dma_addr_t key_dma_addr = 0;
struct ssi_aead_ctx *ctx = crypto_aead_ctx(tfm); struct ssi_aead_ctx *ctx = crypto_aead_ctx(tfm);
struct device *dev = drvdata_to_dev(ctx->drvdata); struct device *dev = drvdata_to_dev(ctx->drvdata);
u32 larval_addr = ssi_ahash_get_larval_digest_sram_addr( u32 larval_addr = cc_larval_digest_addr(ctx->drvdata, ctx->auth_mode);
ctx->drvdata, ctx->auth_mode);
struct ssi_crypto_req ssi_req = {}; struct ssi_crypto_req ssi_req = {};
unsigned int blocksize; unsigned int blocksize;
unsigned int digestsize; unsigned int digestsize;
......
...@@ -150,8 +150,8 @@ static int ssi_hash_map_request(struct device *dev, ...@@ -150,8 +150,8 @@ static int ssi_hash_map_request(struct device *dev,
struct ssi_hash_ctx *ctx) struct ssi_hash_ctx *ctx)
{ {
bool is_hmac = ctx->is_hmac; bool is_hmac = ctx->is_hmac;
ssi_sram_addr_t larval_digest_addr = ssi_ahash_get_larval_digest_sram_addr( ssi_sram_addr_t larval_digest_addr =
ctx->drvdata, ctx->hash_mode); cc_larval_digest_addr(ctx->drvdata, ctx->hash_mode);
struct ssi_crypto_req ssi_req = {}; struct ssi_crypto_req ssi_req = {};
struct cc_hw_desc desc; struct cc_hw_desc desc;
int rc = -ENOMEM; int rc = -ENOMEM;
...@@ -438,8 +438,8 @@ static int ssi_hash_digest(struct ahash_req_ctx *state, ...@@ -438,8 +438,8 @@ static int ssi_hash_digest(struct ahash_req_ctx *state,
bool is_hmac = ctx->is_hmac; bool is_hmac = ctx->is_hmac;
struct ssi_crypto_req ssi_req = {}; struct ssi_crypto_req ssi_req = {};
struct cc_hw_desc desc[SSI_MAX_AHASH_SEQ_LEN]; struct cc_hw_desc desc[SSI_MAX_AHASH_SEQ_LEN];
ssi_sram_addr_t larval_digest_addr = ssi_ahash_get_larval_digest_sram_addr( ssi_sram_addr_t larval_digest_addr =
ctx->drvdata, ctx->hash_mode); cc_larval_digest_addr(ctx->drvdata, ctx->hash_mode);
int idx = 0; int idx = 0;
int rc = 0; int rc = 0;
...@@ -1008,8 +1008,7 @@ static int ssi_hash_setkey(void *hash, ...@@ -1008,8 +1008,7 @@ static int ssi_hash_setkey(void *hash,
blocksize = crypto_tfm_alg_blocksize(&((struct crypto_ahash *)hash)->base); blocksize = crypto_tfm_alg_blocksize(&((struct crypto_ahash *)hash)->base);
digestsize = crypto_ahash_digestsize(((struct crypto_ahash *)hash)); digestsize = crypto_ahash_digestsize(((struct crypto_ahash *)hash));
larval_addr = ssi_ahash_get_larval_digest_sram_addr( larval_addr = cc_larval_digest_addr(ctx->drvdata, ctx->hash_mode);
ctx->drvdata, ctx->hash_mode);
/* The keylen value distinguishes HASH in case keylen is ZERO bytes, /* The keylen value distinguishes HASH in case keylen is ZERO bytes,
* any NON-ZERO value utilizes HMAC flow * any NON-ZERO value utilizes HMAC flow
...@@ -2535,7 +2534,7 @@ static void ssi_hash_create_data_desc(struct ahash_req_ctx *areq_ctx, ...@@ -2535,7 +2534,7 @@ static void ssi_hash_create_data_desc(struct ahash_req_ctx *areq_ctx,
* *
* \return u32 The address of the initial digest in SRAM * \return u32 The address of the initial digest in SRAM
*/ */
ssi_sram_addr_t ssi_ahash_get_larval_digest_sram_addr(void *drvdata, u32 mode) ssi_sram_addr_t cc_larval_digest_addr(void *drvdata, u32 mode)
{ {
struct ssi_drvdata *_drvdata = (struct ssi_drvdata *)drvdata; struct ssi_drvdata *_drvdata = (struct ssi_drvdata *)drvdata;
struct ssi_hash_handle *hash_handle = _drvdata->hash_handle; struct ssi_hash_handle *hash_handle = _drvdata->hash_handle;
......
...@@ -101,7 +101,7 @@ ssi_ahash_get_initial_digest_len_sram_addr(void *drvdata, u32 mode); ...@@ -101,7 +101,7 @@ ssi_ahash_get_initial_digest_len_sram_addr(void *drvdata, u32 mode);
* *
* \return u32 The address of the initial digest in SRAM * \return u32 The address of the initial digest in SRAM
*/ */
ssi_sram_addr_t ssi_ahash_get_larval_digest_sram_addr(void *drvdata, u32 mode); ssi_sram_addr_t cc_larval_digest_addr(void *drvdata, u32 mode);
#endif /*__SSI_HASH_H__*/ #endif /*__SSI_HASH_H__*/
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册