crypto: hash - Make crypto_ahash_alg helper available
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 20 Apr 2023 10:05:41 +0000 (18:05 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 12 May 2023 10:48:01 +0000 (18:48 +0800)
Move the crypto_ahash_alg helper into include/crypto/internal so
that drivers can use it.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/ahash.c
include/crypto/internal/hash.h

index 9986738..709ef09 100644 (file)
@@ -31,12 +31,6 @@ struct ahash_request_priv {
        void *ubuf[] CRYPTO_MINALIGN_ATTR;
 };
 
-static inline struct ahash_alg *crypto_ahash_alg(struct crypto_ahash *hash)
-{
-       return container_of(crypto_hash_alg_common(hash), struct ahash_alg,
-                           halg);
-}
-
 static int hash_walk_next(struct crypto_hash_walk *walk)
 {
        unsigned int alignmask = walk->alignmask;
index b925f82..cf65676 100644 (file)
@@ -149,6 +149,12 @@ static inline struct ahash_alg *__crypto_ahash_alg(struct crypto_alg *alg)
                            halg);
 }
 
+static inline struct ahash_alg *crypto_ahash_alg(struct crypto_ahash *hash)
+{
+       return container_of(crypto_hash_alg_common(hash), struct ahash_alg,
+                           halg);
+}
+
 static inline void crypto_ahash_set_statesize(struct crypto_ahash *tfm,
                                              unsigned int size)
 {