Skip to content

Commit fa919f9

Browse files
0x7f454c46herbertx
authored andcommitted
crypto: api - Remove crypto_init_ops()
Purge crypto_type::init() as well. The last user seems to be gone with commit d63007e ("crypto: ablkcipher - remove deprecated and unused ablkcipher support"). Signed-off-by: Dmitry Safonov <dima@arista.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 6637e11 commit fa919f9

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

crypto/api.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -345,15 +345,6 @@ struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask)
345345
}
346346
EXPORT_SYMBOL_GPL(crypto_alg_mod_lookup);
347347

348-
static int crypto_init_ops(struct crypto_tfm *tfm, u32 type, u32 mask)
349-
{
350-
const struct crypto_type *type_obj = tfm->__crt_alg->cra_type;
351-
352-
if (type_obj)
353-
return type_obj->init(tfm, type, mask);
354-
return 0;
355-
}
356-
357348
static void crypto_exit_ops(struct crypto_tfm *tfm)
358349
{
359350
const struct crypto_type *type = tfm->__crt_alg->cra_type;
@@ -410,18 +401,13 @@ struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type,
410401
tfm->__crt_alg = alg;
411402
refcount_set(&tfm->refcnt, 1);
412403

413-
err = crypto_init_ops(tfm, type, mask);
414-
if (err)
415-
goto out_free_tfm;
416-
417404
if (!tfm->exit && alg->cra_init && (err = alg->cra_init(tfm)))
418405
goto cra_init_failed;
419406

420407
goto out;
421408

422409
cra_init_failed:
423410
crypto_exit_ops(tfm);
424-
out_free_tfm:
425411
if (err == -EAGAIN)
426412
crypto_shoot_alg(alg);
427413
kfree(tfm);

include/crypto/algapi.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ struct sk_buff;
5656
struct crypto_type {
5757
unsigned int (*ctxsize)(struct crypto_alg *alg, u32 type, u32 mask);
5858
unsigned int (*extsize)(struct crypto_alg *alg);
59-
int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask);
6059
int (*init_tfm)(struct crypto_tfm *tfm);
6160
void (*show)(struct seq_file *m, struct crypto_alg *alg);
6261
int (*report)(struct sk_buff *skb, struct crypto_alg *alg);

0 commit comments

Comments
 (0)