diff mbox series

[1/7] crypto: rng - add missing __crypto_rng_cast to the rng header

Message ID 1585943438-862-2-git-send-email-clabbe@baylibre.com (mailing list archive)
State Changes Requested
Delegated to: Herbert Xu
Headers show
Series crypto: sun8i-ss: support PRNG and hashes | expand

Commit Message

Corentin Labbe April 3, 2020, 7:50 p.m. UTC
This patch add __crypto_rng_cast() to the rng header like other
__algo_cast functions.

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
---
 include/crypto/rng.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Herbert Xu April 16, 2020, 6:06 a.m. UTC | #1
On Fri, Apr 03, 2020 at 07:50:32PM +0000, Corentin Labbe wrote:
> This patch add __crypto_rng_cast() to the rng header like other
> __algo_cast functions.
> 
> Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
> ---
>  include/crypto/rng.h | 5 +++++
>  1 file changed, 5 insertions(+)

This should never be exported.  Either change the driver to use
use crypto_tfm_ctx instead of crypto_rng_ctx, or if you have the
time please convert the rng API over to the new way of doing things
like aead/skcipher.

Thanks,
diff mbox series

Patch

diff --git a/include/crypto/rng.h b/include/crypto/rng.h
index 8b4b844b4eef..0e140f132efe 100644
--- a/include/crypto/rng.h
+++ b/include/crypto/rng.h
@@ -198,4 +198,9 @@  static inline int crypto_rng_seedsize(struct crypto_rng *tfm)
 	return crypto_rng_alg(tfm)->seedsize;
 }
 
+static inline struct crypto_rng *__crypto_rng_cast(struct crypto_tfm *tfm)
+{
+	return container_of(tfm, struct crypto_rng, base);
+}
+
 #endif