Skip to content

Commit

Permalink
crypto: api - Remove frontend argument from extsize/init_tfm
Browse files Browse the repository at this point in the history
As the extsize and init_tfm functions belong to the frontend the
frontend argument is superfluous.

Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Jul 14, 2009
1 parent 6b1679f commit 2ca33da
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions crypto/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ void *crypto_create_tfm(struct crypto_alg *alg,
int err = -ENOMEM;

tfmsize = frontend->tfmsize;
total = tfmsize + sizeof(*tfm) + frontend->extsize(alg, frontend);
total = tfmsize + sizeof(*tfm) + frontend->extsize(alg);

mem = kzalloc(total, GFP_KERNEL);
if (mem == NULL)
Expand All @@ -466,7 +466,7 @@ void *crypto_create_tfm(struct crypto_alg *alg,
tfm = (struct crypto_tfm *)(mem + tfmsize);
tfm->__crt_alg = alg;

err = frontend->init_tfm(tfm, frontend);
err = frontend->init_tfm(tfm);
if (err)
goto out_free_tfm;

Expand Down
6 changes: 2 additions & 4 deletions crypto/pcompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@ static int crypto_pcomp_init(struct crypto_tfm *tfm, u32 type, u32 mask)
return 0;
}

static unsigned int crypto_pcomp_extsize(struct crypto_alg *alg,
const struct crypto_type *frontend)
static unsigned int crypto_pcomp_extsize(struct crypto_alg *alg)
{
return alg->cra_ctxsize;
}

static int crypto_pcomp_init_tfm(struct crypto_tfm *tfm,
const struct crypto_type *frontend)
static int crypto_pcomp_init_tfm(struct crypto_tfm *tfm)
{
return 0;
}
Expand Down
6 changes: 2 additions & 4 deletions crypto/shash.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,17 +448,15 @@ static unsigned int crypto_shash_ctxsize(struct crypto_alg *alg, u32 type,
return 0;
}

static int crypto_shash_init_tfm(struct crypto_tfm *tfm,
const struct crypto_type *frontend)
static int crypto_shash_init_tfm(struct crypto_tfm *tfm)
{
struct crypto_shash *hash = __crypto_shash_cast(tfm);

hash->descsize = crypto_shash_alg(hash)->descsize;
return 0;
}

static unsigned int crypto_shash_extsize(struct crypto_alg *alg,
const struct crypto_type *frontend)
static unsigned int crypto_shash_extsize(struct crypto_alg *alg)
{
return alg->cra_ctxsize;
}
Expand Down
6 changes: 2 additions & 4 deletions include/crypto/algapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ struct seq_file;

struct crypto_type {
unsigned int (*ctxsize)(struct crypto_alg *alg, u32 type, u32 mask);
unsigned int (*extsize)(struct crypto_alg *alg,
const struct crypto_type *frontend);
unsigned int (*extsize)(struct crypto_alg *alg);
int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask);
int (*init_tfm)(struct crypto_tfm *tfm,
const struct crypto_type *frontend);
int (*init_tfm)(struct crypto_tfm *tfm);
void (*show)(struct seq_file *m, struct crypto_alg *alg);
struct crypto_alg *(*lookup)(const char *name, u32 type, u32 mask);

Expand Down

0 comments on commit 2ca33da

Please sign in to comment.