Thread (10 messages) 10 messages, 4 authors, 2026-05-29
COLD34d

[PATCH net-next 5/6] crypto: api - Fold __crypto_alloc_tfmgfp() into __crypto_alloc_tfm()

From: Eric Biggers <ebiggers@kernel.org>
Date: 2026-05-22 05:31:07
Also in: linux-crypto, lkml
Subsystem: crypto api, the rest · Maintainers: Herbert Xu, "David S. Miller", Linus Torvalds

This reverts commit fa3b3565f3ac ("crypto: api - Add
__crypto_alloc_tfmgfp").

Fold __crypto_alloc_tfmgfp() into its only remaining caller,
__crypto_alloc_tfm().  Previously __crypto_alloc_tfmgfp() was called by
crypto_clone_cipher(), but crypto_clone_cipher() was removed.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
---
 crypto/api.c      | 13 +++----------
 crypto/internal.h |  2 --
 2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/crypto/api.c b/crypto/api.c
index be9ee104ffc2..5bd0db7fa665 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -403,19 +403,19 @@ void crypto_shoot_alg(struct crypto_alg *alg)
 	alg->cra_flags |= CRYPTO_ALG_DYING;
 	up_write(&crypto_alg_sem);
 }
 EXPORT_SYMBOL_GPL(crypto_shoot_alg);
 
-struct crypto_tfm *__crypto_alloc_tfmgfp(struct crypto_alg *alg, u32 type,
-					 u32 mask, gfp_t gfp)
+struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type,
+				      u32 mask)
 {
 	struct crypto_tfm *tfm;
 	unsigned int tfm_size;
 	int err = -ENOMEM;
 
 	tfm_size = sizeof(*tfm) + crypto_ctxsize(alg, type, mask);
-	tfm = kzalloc(tfm_size, gfp);
+	tfm = kzalloc(tfm_size, GFP_KERNEL);
 	if (tfm == NULL)
 		goto out_err;
 
 	tfm->__crt_alg = alg;
 
@@ -432,17 +432,10 @@ struct crypto_tfm *__crypto_alloc_tfmgfp(struct crypto_alg *alg, u32 type,
 out_err:
 	tfm = ERR_PTR(err);
 out:
 	return tfm;
 }
-EXPORT_SYMBOL_GPL(__crypto_alloc_tfmgfp);
-
-struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type,
-				      u32 mask)
-{
-	return __crypto_alloc_tfmgfp(alg, type, mask, GFP_KERNEL);
-}
 EXPORT_SYMBOL_GPL(__crypto_alloc_tfm);
 
 /*
  *	crypto_alloc_base - Locate algorithm and allocate transform
  *	@alg_name: Name of algorithm
diff --git a/crypto/internal.h b/crypto/internal.h
index b6e437f463d4..b0a10986f61e 100644
--- a/crypto/internal.h
+++ b/crypto/internal.h
@@ -117,12 +117,10 @@ void crypto_alg_tested(const char *name, int err);
 
 void crypto_remove_spawns(struct crypto_alg *alg, struct list_head *list,
 			  struct crypto_alg *nalg);
 void crypto_remove_final(struct list_head *list);
 void crypto_shoot_alg(struct crypto_alg *alg);
-struct crypto_tfm *__crypto_alloc_tfmgfp(struct crypto_alg *alg, u32 type,
-					 u32 mask, gfp_t gfp);
 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);
 
-- 
2.54.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help