Skip to content

Commit

Permalink
crypto: seqiv - remove seqiv_create()
Browse files Browse the repository at this point in the history
seqiv_create() is pointless because it just checks that the template is
being instantiated as an AEAD, then calls seqiv_aead_create().  But
seqiv_aead_create() does the exact same check, via aead_geniv_alloc().

Just remove seqiv_create() and use seqiv_aead_create() directly.

Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ebiggers authored and herbertx committed Jul 16, 2020
1 parent e72b48c commit 4688111
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions crypto/seqiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,23 +164,9 @@ static int seqiv_aead_create(struct crypto_template *tmpl, struct rtattr **tb)
return err;
}

static int seqiv_create(struct crypto_template *tmpl, struct rtattr **tb)
{
struct crypto_attr_type *algt;

algt = crypto_get_attr_type(tb);
if (IS_ERR(algt))
return PTR_ERR(algt);

if ((algt->type ^ CRYPTO_ALG_TYPE_AEAD) & CRYPTO_ALG_TYPE_MASK)
return -EINVAL;

return seqiv_aead_create(tmpl, tb);
}

static struct crypto_template seqiv_tmpl = {
.name = "seqiv",
.create = seqiv_create,
.create = seqiv_aead_create,
.module = THIS_MODULE,
};

Expand Down

0 comments on commit 4688111

Please sign in to comment.