Skip to content

Commit

Permalink
crypto: api - Remove no-op exit_ops code
Browse files Browse the repository at this point in the history
crypto_exit_cipher_ops() and crypto_exit_compress_ops() are no-ops and
have been for a long time, so remove them.

Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ebiggers authored and herbertx committed Oct 21, 2016
1 parent afb5a0a commit 9c8ae17
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 29 deletions.
20 changes: 2 additions & 18 deletions crypto/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,24 +310,8 @@ static void crypto_exit_ops(struct crypto_tfm *tfm)
{
const struct crypto_type *type = tfm->__crt_alg->cra_type;

if (type) {
if (tfm->exit)
tfm->exit(tfm);
return;
}

switch (crypto_tfm_alg_type(tfm)) {
case CRYPTO_ALG_TYPE_CIPHER:
crypto_exit_cipher_ops(tfm);
break;

case CRYPTO_ALG_TYPE_COMPRESS:
crypto_exit_compress_ops(tfm);
break;

default:
BUG();
}
if (type && tfm->exit)
tfm->exit(tfm);
}

static unsigned int crypto_ctxsize(struct crypto_alg *alg, u32 type, u32 mask)
Expand Down
4 changes: 0 additions & 4 deletions crypto/cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,3 @@ int crypto_init_cipher_ops(struct crypto_tfm *tfm)

return 0;
}

void crypto_exit_cipher_ops(struct crypto_tfm *tfm)
{
}
4 changes: 0 additions & 4 deletions crypto/compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,3 @@ int crypto_init_compress_ops(struct crypto_tfm *tfm)

return 0;
}

void crypto_exit_compress_ops(struct crypto_tfm *tfm)
{
}
3 changes: 0 additions & 3 deletions crypto/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask);
int crypto_init_cipher_ops(struct crypto_tfm *tfm);
int crypto_init_compress_ops(struct crypto_tfm *tfm);

void crypto_exit_cipher_ops(struct crypto_tfm *tfm);
void crypto_exit_compress_ops(struct crypto_tfm *tfm);

struct crypto_larval *crypto_larval_alloc(const char *name, u32 type, u32 mask);
void crypto_larval_kill(struct crypto_alg *alg);
struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask);
Expand Down

0 comments on commit 9c8ae17

Please sign in to comment.