From: Eric Biggers Date: Fri, 22 May 2026 05:30:25 +0000 (-0500) Subject: crypto: api - Remove crypto_clone_tfm() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=590a46c68a7b0f9ebbd0248a5a00c472f249c204;p=thirdparty%2Fkernel%2Flinux.git crypto: api - Remove crypto_clone_tfm() Since all callers of crypto_clone_tfm() have been removed, remove it. Note that no tests need to be removed, as this function had no tests. Reviewed-by: Ard Biesheuvel Signed-off-by: Eric Biggers Acked-by: Herbert Xu Link: https://patch.msgid.link/20260522053028.91165-4-ebiggers@kernel.org Signed-off-by: Jakub Kicinski --- diff --git a/crypto/api.c b/crypto/api.c index 74e17d5049c99..d019d1979857d 100644 --- a/crypto/api.c +++ b/crypto/api.c @@ -560,32 +560,6 @@ out: } EXPORT_SYMBOL_GPL(crypto_create_tfm_node); -void *crypto_clone_tfm(const struct crypto_type *frontend, - struct crypto_tfm *otfm) -{ - struct crypto_alg *alg = otfm->__crt_alg; - struct crypto_tfm *tfm; - char *mem; - - mem = ERR_PTR(-ESTALE); - if (unlikely(!crypto_mod_get(alg))) - goto out; - - mem = crypto_alloc_tfmmem(alg, frontend, otfm->node, GFP_ATOMIC); - if (IS_ERR(mem)) { - crypto_mod_put(alg); - goto out; - } - - tfm = (struct crypto_tfm *)(mem + frontend->tfmsize); - tfm->crt_flags = otfm->crt_flags; - tfm->fb = tfm; - -out: - return mem; -} -EXPORT_SYMBOL_GPL(crypto_clone_tfm); - struct crypto_alg *crypto_find_alg(const char *alg_name, const struct crypto_type *frontend, u32 type, u32 mask) diff --git a/crypto/internal.h b/crypto/internal.h index 8fbe0226d48e2..96f84abfac91e 100644 --- a/crypto/internal.h +++ b/crypto/internal.h @@ -126,8 +126,6 @@ struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type, u32 mask); void *crypto_create_tfm_node(struct crypto_alg *alg, const struct crypto_type *frontend, int node); -void *crypto_clone_tfm(const struct crypto_type *frontend, - struct crypto_tfm *otfm); static inline void *crypto_create_tfm(struct crypto_alg *alg, const struct crypto_type *frontend)