Initialization of cra_list is currently mixed, most ciphers initialize this
field and most shashes do not. Initialization however is not needed at all
since cra_list is initialized/overwritten in __crypto_register_alg() with
list_add(). Therefore perform cleanup to remove all unneeded initializations
of this field in 'crypto/drivers/'.
Cc: Kent Yoder
Cc: Benjamin Herrenschmidt
Cc: linux-ge...@lists.infradead.org
Cc: Michal Ludvig
Cc: Dmitry Kasatkin
Cc: Varun Wadekar
Cc: Vladimir Zapolskiy
Cc: Eric Bénard
Signed-off-by: Jussi Kivilinna
---
Drivers that can be compiled on x86 and arm have been compile-tested, but
'nx' driver for ppc64 have not. However since changes are pretty obvious
removal of ".cra_list = " from crypto_alg structures, it should be fine.
---
drivers/crypto/atmel-aes.c |2 --
drivers/crypto/atmel-tdes.c|1 -
drivers/crypto/geode-aes.c |3 ---
drivers/crypto/nx/nx-aes-cbc.c |1 -
drivers/crypto/nx/nx-aes-ccm.c |2 --
drivers/crypto/nx/nx-aes-ctr.c |2 --
drivers/crypto/nx/nx-aes-ecb.c |1 -
drivers/crypto/nx/nx-aes-gcm.c |2 --
drivers/crypto/omap-aes.c |1 -
drivers/crypto/padlock-aes.c |3 ---
drivers/crypto/s5p-sss.c |1 -
drivers/crypto/tegra-aes.c |2 --
12 files changed, 21 deletions(-)
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index 6bb20ff..872ca8c 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -1017,7 +1017,6 @@ static int atmel_aes_register_algs(struct atmel_aes_dev
*dd)
int err, i, j;
for (i = 0; i < ARRAY_SIZE(aes_algs); i++) {
- INIT_LIST_HEAD(&aes_algs[i].cra_list);
err = crypto_register_alg(&aes_algs[i]);
if (err)
goto err_aes_algs;
@@ -1026,7 +1025,6 @@ static int atmel_aes_register_algs(struct atmel_aes_dev
*dd)
atmel_aes_hw_version_init(dd);
if (dd->hw_version >= 0x130) {
- INIT_LIST_HEAD(&aes_cfb64_alg[0].cra_list);
err = crypto_register_alg(&aes_cfb64_alg[0]);
if (err)
goto err_aes_cfb64_alg;
diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c
index eb2b61e..53c1680 100644
--- a/drivers/crypto/atmel-tdes.c
+++ b/drivers/crypto/atmel-tdes.c
@@ -1044,7 +1044,6 @@ static int atmel_tdes_register_algs(struct atmel_tdes_dev
*dd)
int err, i, j;
for (i = 0; i < ARRAY_SIZE(tdes_algs); i++) {
- INIT_LIST_HEAD(&tdes_algs[i].cra_list);
err = crypto_register_alg(&tdes_algs[i]);
if (err)
goto err_tdes_algs;
diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c
index f3e36c8..933fb4b4 100644
--- a/drivers/crypto/geode-aes.c
+++ b/drivers/crypto/geode-aes.c
@@ -289,7 +289,6 @@ static struct crypto_alg geode_alg = {
.cra_blocksize = AES_MIN_BLOCK_SIZE,
.cra_ctxsize= sizeof(struct geode_aes_op),
.cra_module = THIS_MODULE,
- .cra_list =
LIST_HEAD_INIT(geode_alg.cra_list),
.cra_u = {
.cipher = {
.cia_min_keysize= AES_MIN_KEY_SIZE,
@@ -402,7 +401,6 @@ static struct crypto_alg geode_cbc_alg = {
.cra_alignmask = 15,
.cra_type = &crypto_blkcipher_type,
.cra_module = THIS_MODULE,
- .cra_list =
LIST_HEAD_INIT(geode_cbc_alg.cra_list),
.cra_u = {
.blkcipher = {
.min_keysize= AES_MIN_KEY_SIZE,
@@ -489,7 +487,6 @@ static struct crypto_alg geode_ecb_alg = {
.cra_alignmask = 15,
.cra_type = &crypto_blkcipher_type,
.cra_module = THIS_MODULE,
- .cra_list =
LIST_HEAD_INIT(geode_ecb_alg.cra_list),
.cra_u = {
.blkcipher = {
.min_keysize= AES_MIN_KEY_SIZE,
diff --git a/drivers/crypto/nx/nx-aes-cbc.c b/drivers/crypto/nx/nx-aes-cbc.c
index 69ed796..a76d4c4 100644
--- a/drivers/crypto/nx/nx-aes-cbc.c
+++ b/drivers/crypto/nx/nx-aes-cbc.c
@@ -127,7 +127,6 @@ struct crypto_alg nx_cbc_aes_alg = {
.cra_ctxsize = sizeof(struct nx_crypto_ctx),
.cra_type= &crypto_blkcipher_type,
.cra_module = THIS_MODULE,
- .cra_list= LIST_HEAD_INIT(nx_cbc_aes_alg.cra_list),
.cra_init= nx_crypto_ctx_aes_cbc_init,
.cra_exit= nx_crypto_ctx_exit,
.cra_blkcipher = {
diff --git a/drivers/crypto/nx/nx-aes-ccm.c b/drivers/crypto/nx/nx-aes-ccm.c
index