From: Qi Tao <taoqi10@huawei.com>
To: <herbert@gondor.apana.org.au>, <davem@davemloft.net>,
<liulongfang@huawei.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-crypto@vger.kernel.org>
Subject: [PATCH 2/4] crypto: hisilicon/sec2 - modify nested macro call
Date: Fri, 29 Dec 2023 14:44:19 +0800 [thread overview]
Message-ID: <20231229064421.16981-3-taoqi10@huawei.com> (raw)
In-Reply-To: <20231229064421.16981-1-taoqi10@huawei.com>
Nested macros are integrated into a single macro,
making the code simpler.
Signed-off-by: Qi Tao <taoqi10@huawei.com>
---
drivers/crypto/hisilicon/sec2/sec_crypto.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c
index f028dcfd0ead..692ba3213cc6 100644
--- a/drivers/crypto/hisilicon/sec2/sec_crypto.c
+++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c
@@ -2145,8 +2145,8 @@ static int sec_skcipher_decrypt(struct skcipher_request *sk_req)
return sec_skcipher_crypto(sk_req, false);
}
-#define SEC_SKCIPHER_GEN_ALG(sec_cra_name, sec_set_key, sec_min_key_size, \
- sec_max_key_size, ctx_init, ctx_exit, blk_size, iv_size)\
+#define SEC_SKCIPHER_ALG(sec_cra_name, sec_set_key, \
+ sec_min_key_size, sec_max_key_size, blk_size, iv_size)\
{\
.base = {\
.cra_name = sec_cra_name,\
@@ -2158,8 +2158,8 @@ static int sec_skcipher_decrypt(struct skcipher_request *sk_req)
.cra_ctxsize = sizeof(struct sec_ctx),\
.cra_module = THIS_MODULE,\
},\
- .init = ctx_init,\
- .exit = ctx_exit,\
+ .init = sec_skcipher_ctx_init,\
+ .exit = sec_skcipher_ctx_exit,\
.setkey = sec_set_key,\
.decrypt = sec_skcipher_decrypt,\
.encrypt = sec_skcipher_encrypt,\
@@ -2168,11 +2168,6 @@ static int sec_skcipher_decrypt(struct skcipher_request *sk_req)
.ivsize = iv_size,\
}
-#define SEC_SKCIPHER_ALG(name, key_func, min_key_size, \
- max_key_size, blk_size, iv_size) \
- SEC_SKCIPHER_GEN_ALG(name, key_func, min_key_size, max_key_size, \
- sec_skcipher_ctx_init, sec_skcipher_ctx_exit, blk_size, iv_size)
-
static struct sec_skcipher sec_skciphers[] = {
{
.alg_msk = BIT(0),
--
2.33.0
next prev parent reply other threads:[~2023-12-29 6:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-29 6:44 [PATCH v2 0/4] some updates and cleanups for hisilicon/sec2 Qi Tao
2023-12-29 6:44 ` [PATCH 1/4] crypto: hisilicon/sec2 - updates the sec DFX function register Qi Tao
2023-12-29 6:44 ` Qi Tao [this message]
2023-12-29 6:44 ` [PATCH 3/4] crypto: hisilicon/sec2 - fix some cleanup issues Qi Tao
2024-01-25 9:37 ` Herbert Xu
2024-01-26 8:40 ` taoqi
2024-01-26 8:54 ` Herbert Xu
2023-12-29 6:44 ` [PATCH 4/4] crypto: hisilicon/sec - remove unused parameter Qi Tao
2024-01-04 7:58 ` [PATCH v2 0/4] some updates and cleanups for hisilicon/sec2 liulongfang
2024-01-19 6:25 ` taoqi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231229064421.16981-3-taoqi10@huawei.com \
--to=taoqi10@huawei.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liulongfang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®