staging: ccree: rename func for readability
authorGilad Ben-Yossef <gilad@benyossef.com>
Mon, 13 Nov 2017 14:45:46 +0000 (14:45 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Nov 2017 08:20:39 +0000 (09:20 +0100)
Rename the insanely long ssi_ahash_get_larval_digest_sram_addr() func
to cc_larval_digest_addr() for better code readability

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ccree/ssi_aead.c
drivers/staging/ccree/ssi_hash.c
drivers/staging/ccree/ssi_hash.h

index e2cdf52..fcff625 100644 (file)
@@ -336,8 +336,8 @@ static int hmac_setkey(struct cc_hw_desc *desc, struct ssi_aead_ctx *ctx)
                hw_desc_init(&desc[idx]);
                set_cipher_mode(&desc[idx], hash_mode);
                set_din_sram(&desc[idx],
-                            ssi_ahash_get_larval_digest_sram_addr(
-                               ctx->drvdata, ctx->auth_mode),
+                            cc_larval_digest_addr(ctx->drvdata,
+                                                  ctx->auth_mode),
                             digest_size);
                set_flow_mode(&desc[idx], S_DIN_to_HASH);
                set_setup_mode(&desc[idx], SETUP_LOAD_STATE0);
@@ -441,8 +441,7 @@ ssi_get_plain_hmac_key(struct crypto_aead *tfm, const u8 *key,
        dma_addr_t key_dma_addr = 0;
        struct ssi_aead_ctx *ctx = crypto_aead_ctx(tfm);
        struct device *dev = drvdata_to_dev(ctx->drvdata);
-       u32 larval_addr = ssi_ahash_get_larval_digest_sram_addr(
-                                       ctx->drvdata, ctx->auth_mode);
+       u32 larval_addr = cc_larval_digest_addr(ctx->drvdata, ctx->auth_mode);
        struct ssi_crypto_req ssi_req = {};
        unsigned int blocksize;
        unsigned int digestsize;
index bf896a5..10e902c 100644 (file)
@@ -150,8 +150,8 @@ static int ssi_hash_map_request(struct device *dev,
                                struct ssi_hash_ctx *ctx)
 {
        bool is_hmac = ctx->is_hmac;
-       ssi_sram_addr_t larval_digest_addr = ssi_ahash_get_larval_digest_sram_addr(
-                                       ctx->drvdata, ctx->hash_mode);
+       ssi_sram_addr_t larval_digest_addr =
+               cc_larval_digest_addr(ctx->drvdata, ctx->hash_mode);
        struct ssi_crypto_req ssi_req = {};
        struct cc_hw_desc desc;
        int rc = -ENOMEM;
@@ -438,8 +438,8 @@ static int ssi_hash_digest(struct ahash_req_ctx *state,
        bool is_hmac = ctx->is_hmac;
        struct ssi_crypto_req ssi_req = {};
        struct cc_hw_desc desc[SSI_MAX_AHASH_SEQ_LEN];
-       ssi_sram_addr_t larval_digest_addr = ssi_ahash_get_larval_digest_sram_addr(
-                                       ctx->drvdata, ctx->hash_mode);
+       ssi_sram_addr_t larval_digest_addr =
+               cc_larval_digest_addr(ctx->drvdata, ctx->hash_mode);
        int idx = 0;
        int rc = 0;
 
@@ -1008,8 +1008,7 @@ static int ssi_hash_setkey(void *hash,
        blocksize = crypto_tfm_alg_blocksize(&((struct crypto_ahash *)hash)->base);
        digestsize = crypto_ahash_digestsize(((struct crypto_ahash *)hash));
 
-       larval_addr = ssi_ahash_get_larval_digest_sram_addr(
-                                       ctx->drvdata, ctx->hash_mode);
+       larval_addr = cc_larval_digest_addr(ctx->drvdata, ctx->hash_mode);
 
        /* The keylen value distinguishes HASH in case keylen is ZERO bytes,
         * any NON-ZERO value utilizes HMAC flow
@@ -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
  */
-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_hash_handle *hash_handle = _drvdata->hash_handle;
index 8e6eee5..32eb473 100644 (file)
@@ -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
  */
-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__*/