Commit c4af4225 authored by Qi Tao's avatar Qi Tao Committed by Herbert Xu

crypto: hisilicon/sec2 - modify nested macro call

Nested macros are integrated into a single macro,
making the code simpler.
Signed-off-by: default avatarQi Tao <taoqi10@huawei.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 68baa428
...@@ -2145,8 +2145,8 @@ static int sec_skcipher_decrypt(struct skcipher_request *sk_req) ...@@ -2145,8 +2145,8 @@ static int sec_skcipher_decrypt(struct skcipher_request *sk_req)
return sec_skcipher_crypto(sk_req, false); return sec_skcipher_crypto(sk_req, false);
} }
#define SEC_SKCIPHER_GEN_ALG(sec_cra_name, sec_set_key, sec_min_key_size, \ #define SEC_SKCIPHER_ALG(sec_cra_name, sec_set_key, \
sec_max_key_size, ctx_init, ctx_exit, blk_size, iv_size)\ sec_min_key_size, sec_max_key_size, blk_size, iv_size)\
{\ {\
.base = {\ .base = {\
.cra_name = sec_cra_name,\ .cra_name = sec_cra_name,\
...@@ -2158,8 +2158,8 @@ static int sec_skcipher_decrypt(struct skcipher_request *sk_req) ...@@ -2158,8 +2158,8 @@ static int sec_skcipher_decrypt(struct skcipher_request *sk_req)
.cra_ctxsize = sizeof(struct sec_ctx),\ .cra_ctxsize = sizeof(struct sec_ctx),\
.cra_module = THIS_MODULE,\ .cra_module = THIS_MODULE,\
},\ },\
.init = ctx_init,\ .init = sec_skcipher_ctx_init,\
.exit = ctx_exit,\ .exit = sec_skcipher_ctx_exit,\
.setkey = sec_set_key,\ .setkey = sec_set_key,\
.decrypt = sec_skcipher_decrypt,\ .decrypt = sec_skcipher_decrypt,\
.encrypt = sec_skcipher_encrypt,\ .encrypt = sec_skcipher_encrypt,\
...@@ -2168,11 +2168,6 @@ static int sec_skcipher_decrypt(struct skcipher_request *sk_req) ...@@ -2168,11 +2168,6 @@ static int sec_skcipher_decrypt(struct skcipher_request *sk_req)
.ivsize = iv_size,\ .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[] = { static struct sec_skcipher sec_skciphers[] = {
{ {
.alg_msk = BIT(0), .alg_msk = BIT(0),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment