Re: [PATCH v3 1/4] crypto: add template handling for RNGs
From: Stephan Mueller <hidden>
Date: 2016-07-18 07:18:25
Am Montag, 18. Juli 2016, 15:14:17 schrieb Herbert Xu: Hi Herbert,
quoted
diff --git a/crypto/rng.c b/crypto/rng.c index b81cffb..92cc02a 100644 --- a/crypto/rng.c +++ b/crypto/rng.c@@ -232,5 +232,36 @@ void crypto_unregister_rngs(struct rng_alg *algs, intcount) } EXPORT_SYMBOL_GPL(crypto_unregister_rngs); +void rng_free_instance(struct crypto_instance *inst) +{ + crypto_drop_spawn(crypto_instance_ctx(inst)); + kfree(rng_instance(inst)); +}Please use the new free interface, i.e., void rng_free_instance(struct rng_instance *inst) and then inst->free = rng_free_instance;quoted
+static inline struct rng_alg *__crypto_rng_alg(struct crypto_alg *alg) +{ + return container_of(alg, struct rng_alg, base); +} + +static inline struct rng_instance *rng_instance( + struct crypto_instance *inst) +{ + return container_of(__crypto_rng_alg(&inst->alg), + struct rng_instance, alg); +}These two can then be deleted.
Thanks. I will add that to the next round.
Thanks,
Ciao Stephan