Commit d4165590 authored by Eric Biggers's avatar Eric Biggers Committed by Herbert Xu
Browse files

crypto: remove useless initializations of cra_list



Some algorithms initialize their .cra_list prior to registration.
But this is unnecessary since crypto_register_alg() will overwrite
.cra_list when adding the algorithm to the 'crypto_alg_list'.
Apparently the useless assignment has just been copy+pasted around.

So, remove the useless assignments.

Exception: paes_s390.c uses cra_list to check whether the algorithm is
registered or not, so I left that as-is for now.

This patch shouldn't change any actual behavior.

Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 2b78aeb3
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -476,11 +476,6 @@ static bool __init sparc64_has_aes_opcode(void)

static int __init aes_sparc64_mod_init(void)
{
	int i;

	for (i = 0; i < ARRAY_SIZE(algs); i++)
		INIT_LIST_HEAD(&algs[i].cra_list);

	if (sparc64_has_aes_opcode()) {
		pr_info("Using sparc64 aes opcodes optimized AES implementation\n");
		return crypto_register_algs(algs, ARRAY_SIZE(algs));
+0 −5
Original line number Diff line number Diff line
@@ -299,11 +299,6 @@ static bool __init sparc64_has_camellia_opcode(void)

static int __init camellia_sparc64_mod_init(void)
{
	int i;

	for (i = 0; i < ARRAY_SIZE(algs); i++)
		INIT_LIST_HEAD(&algs[i].cra_list);

	if (sparc64_has_camellia_opcode()) {
		pr_info("Using sparc64 camellia opcodes optimized CAMELLIA implementation\n");
		return crypto_register_algs(algs, ARRAY_SIZE(algs));
+0 −5
Original line number Diff line number Diff line
@@ -510,11 +510,6 @@ static bool __init sparc64_has_des_opcode(void)

static int __init des_sparc64_mod_init(void)
{
	int i;

	for (i = 0; i < ARRAY_SIZE(algs); i++)
		INIT_LIST_HEAD(&algs[i].cra_list);

	if (sparc64_has_des_opcode()) {
		pr_info("Using sparc64 des opcodes optimized DES implementation\n");
		return crypto_register_algs(algs, ARRAY_SIZE(algs));
+0 −1
Original line number Diff line number Diff line
@@ -122,7 +122,6 @@ static struct crypto_alg alg_lz4 = {
	.cra_flags		= CRYPTO_ALG_TYPE_COMPRESS,
	.cra_ctxsize		= sizeof(struct lz4_ctx),
	.cra_module		= THIS_MODULE,
	.cra_list		= LIST_HEAD_INIT(alg_lz4.cra_list),
	.cra_init		= lz4_init,
	.cra_exit		= lz4_exit,
	.cra_u			= { .compress = {
+0 −1
Original line number Diff line number Diff line
@@ -123,7 +123,6 @@ static struct crypto_alg alg_lz4hc = {
	.cra_flags		= CRYPTO_ALG_TYPE_COMPRESS,
	.cra_ctxsize		= sizeof(struct lz4hc_ctx),
	.cra_module		= THIS_MODULE,
	.cra_list		= LIST_HEAD_INIT(alg_lz4hc.cra_list),
	.cra_init		= lz4hc_init,
	.cra_exit		= lz4hc_exit,
	.cra_u			= { .compress = {
Loading