diff options
author | Corentin Labbe <clabbe@baylibre.com> | 2018-11-29 09:42:16 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-12-07 01:15:00 -0500 |
commit | 2ced26078fcff26db532d6300a1b5f8ffd11a5e1 (patch) | |
tree | b132cfafef62c742cc0bcfa680984736f3d6e59f /crypto/algapi.c | |
parent | c97e4df573f2434b07f08d3b93673f61158d267f (diff) |
crypto: user - made crypto_user_stat optional
Even if CRYPTO_STATS is set to n, some part of CRYPTO_STATS are
compiled.
This patch made all part of crypto_user_stat uncompiled in that case.
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/algapi.c')
-rw-r--r-- | crypto/algapi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c index 2545c5f89c4c..f5396c88e8cd 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c | |||
@@ -258,6 +258,7 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg) | |||
258 | list_add(&alg->cra_list, &crypto_alg_list); | 258 | list_add(&alg->cra_list, &crypto_alg_list); |
259 | list_add(&larval->alg.cra_list, &crypto_alg_list); | 259 | list_add(&larval->alg.cra_list, &crypto_alg_list); |
260 | 260 | ||
261 | #ifdef CONFIG_CRYPTO_STATS | ||
261 | atomic_set(&alg->encrypt_cnt, 0); | 262 | atomic_set(&alg->encrypt_cnt, 0); |
262 | atomic_set(&alg->decrypt_cnt, 0); | 263 | atomic_set(&alg->decrypt_cnt, 0); |
263 | atomic64_set(&alg->encrypt_tlen, 0); | 264 | atomic64_set(&alg->encrypt_tlen, 0); |
@@ -265,6 +266,7 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg) | |||
265 | atomic_set(&alg->verify_cnt, 0); | 266 | atomic_set(&alg->verify_cnt, 0); |
266 | atomic_set(&alg->cipher_err_cnt, 0); | 267 | atomic_set(&alg->cipher_err_cnt, 0); |
267 | atomic_set(&alg->sign_cnt, 0); | 268 | atomic_set(&alg->sign_cnt, 0); |
269 | #endif | ||
268 | 270 | ||
269 | out: | 271 | out: |
270 | return larval; | 272 | return larval; |