diff options
author | Daniel Kestrel <kestrel1974@t-online.de> | 2021-06-15 17:33:24 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2022-01-06 00:23:02 +0100 |
commit | 6ade9d1ddac660e7f06116359c0812adde86bf9e (patch) | |
tree | 4c7af1344afbb7137f3a6a5efd47cfebdd15dd90 /package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c | |
parent | 0470b05b568c9d9b7188e83c1303d0acac64921d (diff) | |
download | upstream-6ade9d1ddac660e7f06116359c0812adde86bf9e.tar.gz upstream-6ade9d1ddac660e7f06116359c0812adde86bf9e.tar.bz2 upstream-6ade9d1ddac660e7f06116359c0812adde86bf9e.zip |
ltq-deu: remove compiler warning and shorten locked sections
Removing hash pointer in _hmac_setkey since its not needed and causes
a compiler warning.
Make the spinlock control sections shorter and move initializations
out of the control sections to free the spinlock faster for allowing
other threads to use the hash engine.
Minor improvements for indentation and removal of blanks and blank
lines in some areas.
Signed-off-by: Daniel Kestrel <kestrel1974@t-online.de>
Diffstat (limited to 'package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c')
-rw-r--r-- | package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c index 72770a38e8..9adf4d4710 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c @@ -38,7 +38,6 @@ \brief ifx sha1 hmac functions */ - /* Project header */ #include <linux/init.h> #include <linux/module.h> @@ -125,7 +124,6 @@ static int sha1_hmac_transform(struct shash_desc *desc, u32 const *in) static int sha1_hmac_setkey(struct crypto_shash *tfm, const u8 *key, unsigned int keylen) { struct sha1_hmac_ctx *sctx = crypto_shash_ctx(tfm); - volatile struct deu_hash_t *hash = (struct deu_hash_t *) HASH_START; int err; if (keylen > SHA1_HMAC_MAX_KEYLEN) { @@ -152,7 +150,6 @@ static int sha1_hmac_setkey(struct crypto_shash *tfm, const u8 *key, unsigned in return 0; } - /*! \fn int sha1_hmac_setkey_hw(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) * \ingroup IFX_SHA1_HMAC_FUNCTIONS * \brief sets sha1 hmac key into hw registers @@ -351,6 +348,8 @@ static int sha1_hmac_final_impl(struct shash_desc *desc, u8 *out, bool hash_fina *((u32 *) out + 3) = hashs->D4R; *((u32 *) out + 4) = hashs->D5R; + CRTCL_SECT_HASH_END; + if (hash_final) { memset(&sctx->buffer[0], 0, SHA1_HMAC_BLOCK_SIZE); sctx->count = 0; @@ -358,8 +357,6 @@ static int sha1_hmac_final_impl(struct shash_desc *desc, u8 *out, bool hash_fina sctx->dbn = 0; } //printk("debug ln: %d, fn: %s\n", __LINE__, __func__); - CRTCL_SECT_HASH_END; - return 0; @@ -393,7 +390,6 @@ static void sha1_hmac_exit_tfm(struct crypto_tfm *tfm) kfree(sctx->desc); } - /* * \brief SHA1_HMAC function mappings */ @@ -418,7 +414,6 @@ static struct shash_alg ifxdeu_sha1_hmac_alg = { } }; - /*! \fn int ifxdeu_init_sha1_hmac (void) * \ingroup IFX_SHA1_HMAC_FUNCTIONS * \brief initialize sha1 hmac driver @@ -451,4 +446,3 @@ void ifxdeu_fini_sha1_hmac (void) } - |