Skip to content

Commit

Permalink
crypto: api - Remove crypto_init_ops()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Safonov authored and Herbert Xu committed Jun 23, 2023
1 parent 6637e11 commit fa919f9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
14 changes: 0 additions & 14 deletions crypto/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,6 @@ struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask)
}
EXPORT_SYMBOL_GPL(crypto_alg_mod_lookup);

static int crypto_init_ops(struct crypto_tfm *tfm, u32 type, u32 mask)
{
const struct crypto_type *type_obj = tfm->__crt_alg->cra_type;

if (type_obj)
return type_obj->init(tfm, type, mask);
return 0;
}

static void crypto_exit_ops(struct crypto_tfm *tfm)
{
const struct crypto_type *type = tfm->__crt_alg->cra_type;
Expand Down Expand Up @@ -410,18 +401,13 @@ struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type,
tfm->__crt_alg = alg;
refcount_set(&tfm->refcnt, 1);

err = crypto_init_ops(tfm, type, mask);
if (err)
goto out_free_tfm;

if (!tfm->exit && alg->cra_init && (err = alg->cra_init(tfm)))
goto cra_init_failed;

goto out;

cra_init_failed:
crypto_exit_ops(tfm);
out_free_tfm:
if (err == -EAGAIN)
crypto_shoot_alg(alg);
kfree(tfm);
Expand Down
1 change: 0 additions & 1 deletion include/crypto/algapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ struct sk_buff;
struct crypto_type {
unsigned int (*ctxsize)(struct crypto_alg *alg, u32 type, u32 mask);
unsigned int (*extsize)(struct crypto_alg *alg);
int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask);
int (*init_tfm)(struct crypto_tfm *tfm);
void (*show)(struct seq_file *m, struct crypto_alg *alg);
int (*report)(struct sk_buff *skb, struct crypto_alg *alg);
Expand Down

0 comments on commit fa919f9

Please sign in to comment.