From: Eric Biggers <ebiggers@kernel.org>
To: Mikulas Patocka <mpatocka@redhat.com>, linux-crypto@vger.kernel.org
Cc: dm-devel@redhat.com
Subject: [PATCH v2 2/7] crypto: seqiv - remove seqiv_create()
Date: Thu, 9 Jul 2020 23:20:37 -0700 [thread overview]
Message-ID: <20200710062042.113842-3-ebiggers@kernel.org> (raw)
In-Reply-To: <20200710062042.113842-1-ebiggers@kernel.org>
From: Eric Biggers <ebiggers@google.com>
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 <ebiggers@google.com>
---
crypto/seqiv.c | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/crypto/seqiv.c b/crypto/seqiv.c
index e48f875a7aac..23e22d8b63e6 100644
--- a/crypto/seqiv.c
+++ b/crypto/seqiv.c
@@ -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,
};
--
2.27.0
next prev parent reply other threads:[~2020-07-10 6:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-10 6:20 [PATCH v2 0/7] crypto: add CRYPTO_ALG_ALLOCATES_MEMORY Eric Biggers
2020-07-10 6:20 ` [PATCH v2 1/7] crypto: geniv - remove unneeded arguments from aead_geniv_alloc() Eric Biggers
2020-07-10 6:20 ` Eric Biggers [this message]
2020-07-10 6:20 ` [PATCH v2 3/7] crypto: algapi - use common mechanism for inheriting flags Eric Biggers
2020-07-10 6:20 ` [PATCH v2 4/7] crypto: algapi - add NEED_FALLBACK to INHERITED_FLAGS Eric Biggers
2020-07-10 6:20 ` [PATCH v2 5/7] crypto: algapi - introduce the flag CRYPTO_ALG_ALLOCATES_MEMORY Eric Biggers
2020-07-10 6:20 ` [PATCH v2 6/7] crypto: drivers - set " Eric Biggers
2020-07-10 6:20 ` [PATCH v2 7/7] dm-crypt: don't use drivers that have CRYPTO_ALG_ALLOCATES_MEMORY Eric Biggers
2020-07-16 11:55 ` [PATCH v2 0/7] crypto: add CRYPTO_ALG_ALLOCATES_MEMORY Herbert Xu
2020-07-17 14:42 ` Horia Geantă
2020-07-22 7:29 ` Herbert Xu
2020-11-19 18:29 ` Iuliana Prodan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200710062042.113842-3-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=dm-devel@redhat.com \
--cc=linux-crypto@vger.kernel.org \
--cc=mpatocka@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).