diff options
| author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2012-07-11 07:20:56 -0400 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2012-08-01 05:47:28 -0400 |
| commit | e15aa3692da1dcee3172966a878b04a1e0f514b3 (patch) | |
| tree | 0b9f118a6a38317524969845f21e8722f3414742 | |
| parent | 7af6c2456851eb08d51d95de38ae8302994031e9 (diff) | |
crypto: drivers - remove cra_list initialization
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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linux-geode@lists.infradead.org
Cc: Michal Ludvig <michal@logix.cz>
Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
Cc: Varun Wadekar <vwadekar@nvidia.com>
Cc: Eric Bénard <eric@eukrea.com>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Acked-by: Kent Yoder <key@linux.vnet.ibm.com>
Acked-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
| -rw-r--r-- | drivers/crypto/atmel-aes.c | 2 | ||||
| -rw-r--r-- | drivers/crypto/atmel-tdes.c | 1 | ||||
| -rw-r--r-- | drivers/crypto/geode-aes.c | 3 | ||||
| -rw-r--r-- | drivers/crypto/nx/nx-aes-cbc.c | 1 | ||||
| -rw-r--r-- | drivers/crypto/nx/nx-aes-ccm.c | 2 | ||||
| -rw-r--r-- | drivers/crypto/nx/nx-aes-ctr.c | 2 | ||||
| -rw-r--r-- | drivers/crypto/nx/nx-aes-ecb.c | 1 | ||||
| -rw-r--r-- | drivers/crypto/nx/nx-aes-gcm.c | 2 | ||||
| -rw-r--r-- | drivers/crypto/omap-aes.c | 1 | ||||
| -rw-r--r-- | drivers/crypto/padlock-aes.c | 3 | ||||
| -rw-r--r-- | drivers/crypto/s5p-sss.c | 1 | ||||
| -rw-r--r-- | drivers/crypto/tegra-aes.c | 2 |
12 files changed, 0 insertions, 21 deletions
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 6bb20fffbf49..872ca8c8d83b 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) | |||
| 1017 | int err, i, j; | 1017 | int err, i, j; |
| 1018 | 1018 | ||
| 1019 | for (i = 0; i < ARRAY_SIZE(aes_algs); i++) { | 1019 | for (i = 0; i < ARRAY_SIZE(aes_algs); i++) { |
| 1020 | INIT_LIST_HEAD(&aes_algs[i].cra_list); | ||
| 1021 | err = crypto_register_alg(&aes_algs[i]); | 1020 | err = crypto_register_alg(&aes_algs[i]); |
| 1022 | if (err) | 1021 | if (err) |
| 1023 | goto err_aes_algs; | 1022 | goto err_aes_algs; |
| @@ -1026,7 +1025,6 @@ static int atmel_aes_register_algs(struct atmel_aes_dev *dd) | |||
| 1026 | atmel_aes_hw_version_init(dd); | 1025 | atmel_aes_hw_version_init(dd); |
| 1027 | 1026 | ||
| 1028 | if (dd->hw_version >= 0x130) { | 1027 | if (dd->hw_version >= 0x130) { |
| 1029 | INIT_LIST_HEAD(&aes_cfb64_alg[0].cra_list); | ||
| 1030 | err = crypto_register_alg(&aes_cfb64_alg[0]); | 1028 | err = crypto_register_alg(&aes_cfb64_alg[0]); |
| 1031 | if (err) | 1029 | if (err) |
| 1032 | goto err_aes_cfb64_alg; | 1030 | goto err_aes_cfb64_alg; |
diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index eb2b61e57e2d..53c1680b5513 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) | |||
| 1044 | int err, i, j; | 1044 | int err, i, j; |
| 1045 | 1045 | ||
| 1046 | for (i = 0; i < ARRAY_SIZE(tdes_algs); i++) { | 1046 | for (i = 0; i < ARRAY_SIZE(tdes_algs); i++) { |
| 1047 | INIT_LIST_HEAD(&tdes_algs[i].cra_list); | ||
| 1048 | err = crypto_register_alg(&tdes_algs[i]); | 1047 | err = crypto_register_alg(&tdes_algs[i]); |
| 1049 | if (err) | 1048 | if (err) |
| 1050 | goto err_tdes_algs; | 1049 | goto err_tdes_algs; |
diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c index f3e36c86b6c3..933fb4b4a4c7 100644 --- a/drivers/crypto/geode-aes.c +++ b/drivers/crypto/geode-aes.c | |||
| @@ -289,7 +289,6 @@ static struct crypto_alg geode_alg = { | |||
| 289 | .cra_blocksize = AES_MIN_BLOCK_SIZE, | 289 | .cra_blocksize = AES_MIN_BLOCK_SIZE, |
| 290 | .cra_ctxsize = sizeof(struct geode_aes_op), | 290 | .cra_ctxsize = sizeof(struct geode_aes_op), |
| 291 | .cra_module = THIS_MODULE, | 291 | .cra_module = THIS_MODULE, |
| 292 | .cra_list = LIST_HEAD_INIT(geode_alg.cra_list), | ||
| 293 | .cra_u = { | 292 | .cra_u = { |
| 294 | .cipher = { | 293 | .cipher = { |
| 295 | .cia_min_keysize = AES_MIN_KEY_SIZE, | 294 | .cia_min_keysize = AES_MIN_KEY_SIZE, |
| @@ -402,7 +401,6 @@ static struct crypto_alg geode_cbc_alg = { | |||
| 402 | .cra_alignmask = 15, | 401 | .cra_alignmask = 15, |
| 403 | .cra_type = &crypto_blkcipher_type, | 402 | .cra_type = &crypto_blkcipher_type, |
| 404 | .cra_module = THIS_MODULE, | 403 | .cra_module = THIS_MODULE, |
| 405 | .cra_list = LIST_HEAD_INIT(geode_cbc_alg.cra_list), | ||
| 406 | .cra_u = { | 404 | .cra_u = { |
| 407 | .blkcipher = { | 405 | .blkcipher = { |
| 408 | .min_keysize = AES_MIN_KEY_SIZE, | 406 | .min_keysize = AES_MIN_KEY_SIZE, |
| @@ -489,7 +487,6 @@ static struct crypto_alg geode_ecb_alg = { | |||
| 489 | .cra_alignmask = 15, | 487 | .cra_alignmask = 15, |
| 490 | .cra_type = &crypto_blkcipher_type, | 488 | .cra_type = &crypto_blkcipher_type, |
| 491 | .cra_module = THIS_MODULE, | 489 | .cra_module = THIS_MODULE, |
| 492 | .cra_list = LIST_HEAD_INIT(geode_ecb_alg.cra_list), | ||
| 493 | .cra_u = { | 490 | .cra_u = { |
| 494 | .blkcipher = { | 491 | .blkcipher = { |
| 495 | .min_keysize = AES_MIN_KEY_SIZE, | 492 | .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 69ed796ee327..a76d4c4f29f5 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 = { | |||
| 127 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), | 127 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), |
| 128 | .cra_type = &crypto_blkcipher_type, | 128 | .cra_type = &crypto_blkcipher_type, |
| 129 | .cra_module = THIS_MODULE, | 129 | .cra_module = THIS_MODULE, |
| 130 | .cra_list = LIST_HEAD_INIT(nx_cbc_aes_alg.cra_list), | ||
| 131 | .cra_init = nx_crypto_ctx_aes_cbc_init, | 130 | .cra_init = nx_crypto_ctx_aes_cbc_init, |
| 132 | .cra_exit = nx_crypto_ctx_exit, | 131 | .cra_exit = nx_crypto_ctx_exit, |
| 133 | .cra_blkcipher = { | 132 | .cra_blkcipher = { |
diff --git a/drivers/crypto/nx/nx-aes-ccm.c b/drivers/crypto/nx/nx-aes-ccm.c index 7aeac678b9c0..ef5eae6d1400 100644 --- a/drivers/crypto/nx/nx-aes-ccm.c +++ b/drivers/crypto/nx/nx-aes-ccm.c | |||
| @@ -430,7 +430,6 @@ struct crypto_alg nx_ccm_aes_alg = { | |||
| 430 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), | 430 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), |
| 431 | .cra_type = &crypto_aead_type, | 431 | .cra_type = &crypto_aead_type, |
| 432 | .cra_module = THIS_MODULE, | 432 | .cra_module = THIS_MODULE, |
| 433 | .cra_list = LIST_HEAD_INIT(nx_ccm_aes_alg.cra_list), | ||
| 434 | .cra_init = nx_crypto_ctx_aes_ccm_init, | 433 | .cra_init = nx_crypto_ctx_aes_ccm_init, |
| 435 | .cra_exit = nx_crypto_ctx_exit, | 434 | .cra_exit = nx_crypto_ctx_exit, |
| 436 | .cra_aead = { | 435 | .cra_aead = { |
| @@ -453,7 +452,6 @@ struct crypto_alg nx_ccm4309_aes_alg = { | |||
| 453 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), | 452 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), |
| 454 | .cra_type = &crypto_nivaead_type, | 453 | .cra_type = &crypto_nivaead_type, |
| 455 | .cra_module = THIS_MODULE, | 454 | .cra_module = THIS_MODULE, |
| 456 | .cra_list = LIST_HEAD_INIT(nx_ccm4309_aes_alg.cra_list), | ||
| 457 | .cra_init = nx_crypto_ctx_aes_ccm_init, | 455 | .cra_init = nx_crypto_ctx_aes_ccm_init, |
| 458 | .cra_exit = nx_crypto_ctx_exit, | 456 | .cra_exit = nx_crypto_ctx_exit, |
| 459 | .cra_aead = { | 457 | .cra_aead = { |
diff --git a/drivers/crypto/nx/nx-aes-ctr.c b/drivers/crypto/nx/nx-aes-ctr.c index 52d4eb05e8f7..b6286f14680b 100644 --- a/drivers/crypto/nx/nx-aes-ctr.c +++ b/drivers/crypto/nx/nx-aes-ctr.c | |||
| @@ -141,7 +141,6 @@ struct crypto_alg nx_ctr_aes_alg = { | |||
| 141 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), | 141 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), |
| 142 | .cra_type = &crypto_blkcipher_type, | 142 | .cra_type = &crypto_blkcipher_type, |
| 143 | .cra_module = THIS_MODULE, | 143 | .cra_module = THIS_MODULE, |
| 144 | .cra_list = LIST_HEAD_INIT(nx_ctr_aes_alg.cra_list), | ||
| 145 | .cra_init = nx_crypto_ctx_aes_ctr_init, | 144 | .cra_init = nx_crypto_ctx_aes_ctr_init, |
| 146 | .cra_exit = nx_crypto_ctx_exit, | 145 | .cra_exit = nx_crypto_ctx_exit, |
| 147 | .cra_blkcipher = { | 146 | .cra_blkcipher = { |
| @@ -163,7 +162,6 @@ struct crypto_alg nx_ctr3686_aes_alg = { | |||
| 163 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), | 162 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), |
| 164 | .cra_type = &crypto_blkcipher_type, | 163 | .cra_type = &crypto_blkcipher_type, |
| 165 | .cra_module = THIS_MODULE, | 164 | .cra_module = THIS_MODULE, |
| 166 | .cra_list = LIST_HEAD_INIT(nx_ctr3686_aes_alg.cra_list), | ||
| 167 | .cra_init = nx_crypto_ctx_aes_ctr_init, | 165 | .cra_init = nx_crypto_ctx_aes_ctr_init, |
| 168 | .cra_exit = nx_crypto_ctx_exit, | 166 | .cra_exit = nx_crypto_ctx_exit, |
| 169 | .cra_blkcipher = { | 167 | .cra_blkcipher = { |
diff --git a/drivers/crypto/nx/nx-aes-ecb.c b/drivers/crypto/nx/nx-aes-ecb.c index 7b77bc2d1df4..ba5f1611336f 100644 --- a/drivers/crypto/nx/nx-aes-ecb.c +++ b/drivers/crypto/nx/nx-aes-ecb.c | |||
| @@ -126,7 +126,6 @@ struct crypto_alg nx_ecb_aes_alg = { | |||
| 126 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), | 126 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), |
| 127 | .cra_type = &crypto_blkcipher_type, | 127 | .cra_type = &crypto_blkcipher_type, |
| 128 | .cra_module = THIS_MODULE, | 128 | .cra_module = THIS_MODULE, |
| 129 | .cra_list = LIST_HEAD_INIT(nx_ecb_aes_alg.cra_list), | ||
| 130 | .cra_init = nx_crypto_ctx_aes_ecb_init, | 129 | .cra_init = nx_crypto_ctx_aes_ecb_init, |
| 131 | .cra_exit = nx_crypto_ctx_exit, | 130 | .cra_exit = nx_crypto_ctx_exit, |
| 132 | .cra_blkcipher = { | 131 | .cra_blkcipher = { |
diff --git a/drivers/crypto/nx/nx-aes-gcm.c b/drivers/crypto/nx/nx-aes-gcm.c index 9ab1c7341dac..c8109edc5cfb 100644 --- a/drivers/crypto/nx/nx-aes-gcm.c +++ b/drivers/crypto/nx/nx-aes-gcm.c | |||
| @@ -316,7 +316,6 @@ struct crypto_alg nx_gcm_aes_alg = { | |||
| 316 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), | 316 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), |
| 317 | .cra_type = &crypto_aead_type, | 317 | .cra_type = &crypto_aead_type, |
| 318 | .cra_module = THIS_MODULE, | 318 | .cra_module = THIS_MODULE, |
| 319 | .cra_list = LIST_HEAD_INIT(nx_gcm_aes_alg.cra_list), | ||
| 320 | .cra_init = nx_crypto_ctx_aes_gcm_init, | 319 | .cra_init = nx_crypto_ctx_aes_gcm_init, |
| 321 | .cra_exit = nx_crypto_ctx_exit, | 320 | .cra_exit = nx_crypto_ctx_exit, |
| 322 | .cra_aead = { | 321 | .cra_aead = { |
| @@ -338,7 +337,6 @@ struct crypto_alg nx_gcm4106_aes_alg = { | |||
| 338 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), | 337 | .cra_ctxsize = sizeof(struct nx_crypto_ctx), |
| 339 | .cra_type = &crypto_nivaead_type, | 338 | .cra_type = &crypto_nivaead_type, |
| 340 | .cra_module = THIS_MODULE, | 339 | .cra_module = THIS_MODULE, |
| 341 | .cra_list = LIST_HEAD_INIT(nx_gcm4106_aes_alg.cra_list), | ||
| 342 | .cra_init = nx_crypto_ctx_aes_gcm_init, | 340 | .cra_init = nx_crypto_ctx_aes_gcm_init, |
| 343 | .cra_exit = nx_crypto_ctx_exit, | 341 | .cra_exit = nx_crypto_ctx_exit, |
| 344 | .cra_aead = { | 342 | .cra_aead = { |
diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c index 63e57b57a12c..093a8af59cbe 100644 --- a/drivers/crypto/omap-aes.c +++ b/drivers/crypto/omap-aes.c | |||
| @@ -876,7 +876,6 @@ static int omap_aes_probe(struct platform_device *pdev) | |||
| 876 | 876 | ||
| 877 | for (i = 0; i < ARRAY_SIZE(algs); i++) { | 877 | for (i = 0; i < ARRAY_SIZE(algs); i++) { |
| 878 | pr_debug("i: %d\n", i); | 878 | pr_debug("i: %d\n", i); |
| 879 | INIT_LIST_HEAD(&algs[i].cra_list); | ||
| 880 | err = crypto_register_alg(&algs[i]); | 879 | err = crypto_register_alg(&algs[i]); |
| 881 | if (err) | 880 | if (err) |
| 882 | goto err_algs; | 881 | goto err_algs; |
diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c index 37b2e9406af6..633ba945e153 100644 --- a/drivers/crypto/padlock-aes.c +++ b/drivers/crypto/padlock-aes.c | |||
| @@ -328,7 +328,6 @@ static struct crypto_alg aes_alg = { | |||
| 328 | .cra_ctxsize = sizeof(struct aes_ctx), | 328 | .cra_ctxsize = sizeof(struct aes_ctx), |
| 329 | .cra_alignmask = PADLOCK_ALIGNMENT - 1, | 329 | .cra_alignmask = PADLOCK_ALIGNMENT - 1, |
| 330 | .cra_module = THIS_MODULE, | 330 | .cra_module = THIS_MODULE, |
| 331 | .cra_list = LIST_HEAD_INIT(aes_alg.cra_list), | ||
| 332 | .cra_u = { | 331 | .cra_u = { |
| 333 | .cipher = { | 332 | .cipher = { |
| 334 | .cia_min_keysize = AES_MIN_KEY_SIZE, | 333 | .cia_min_keysize = AES_MIN_KEY_SIZE, |
| @@ -408,7 +407,6 @@ static struct crypto_alg ecb_aes_alg = { | |||
| 408 | .cra_alignmask = PADLOCK_ALIGNMENT - 1, | 407 | .cra_alignmask = PADLOCK_ALIGNMENT - 1, |
| 409 | .cra_type = &crypto_blkcipher_type, | 408 | .cra_type = &crypto_blkcipher_type, |
| 410 | .cra_module = THIS_MODULE, | 409 | .cra_module = THIS_MODULE, |
| 411 | .cra_list = LIST_HEAD_INIT(ecb_aes_alg.cra_list), | ||
| 412 | .cra_u = { | 410 | .cra_u = { |
| 413 | .blkcipher = { | 411 | .blkcipher = { |
| 414 | .min_keysize = AES_MIN_KEY_SIZE, | 412 | .min_keysize = AES_MIN_KEY_SIZE, |
| @@ -491,7 +489,6 @@ static struct crypto_alg cbc_aes_alg = { | |||
| 491 | .cra_alignmask = PADLOCK_ALIGNMENT - 1, | 489 | .cra_alignmask = PADLOCK_ALIGNMENT - 1, |
| 492 | .cra_type = &crypto_blkcipher_type, | 490 | .cra_type = &crypto_blkcipher_type, |
| 493 | .cra_module = THIS_MODULE, | 491 | .cra_module = THIS_MODULE, |
| 494 | .cra_list = LIST_HEAD_INIT(cbc_aes_alg.cra_list), | ||
| 495 | .cra_u = { | 492 | .cra_u = { |
| 496 | .blkcipher = { | 493 | .blkcipher = { |
| 497 | .min_keysize = AES_MIN_KEY_SIZE, | 494 | .min_keysize = AES_MIN_KEY_SIZE, |
diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index bc986f806086..a22714412cda 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c | |||
| @@ -626,7 +626,6 @@ static int s5p_aes_probe(struct platform_device *pdev) | |||
| 626 | crypto_init_queue(&pdata->queue, CRYPTO_QUEUE_LEN); | 626 | crypto_init_queue(&pdata->queue, CRYPTO_QUEUE_LEN); |
| 627 | 627 | ||
| 628 | for (i = 0; i < ARRAY_SIZE(algs); i++) { | 628 | for (i = 0; i < ARRAY_SIZE(algs); i++) { |
| 629 | INIT_LIST_HEAD(&algs[i].cra_list); | ||
| 630 | err = crypto_register_alg(&algs[i]); | 629 | err = crypto_register_alg(&algs[i]); |
| 631 | if (err) | 630 | if (err) |
| 632 | goto err_algs; | 631 | goto err_algs; |
diff --git a/drivers/crypto/tegra-aes.c b/drivers/crypto/tegra-aes.c index ac236f6724f4..631149e50ef1 100644 --- a/drivers/crypto/tegra-aes.c +++ b/drivers/crypto/tegra-aes.c | |||
| @@ -1004,8 +1004,6 @@ static int tegra_aes_probe(struct platform_device *pdev) | |||
| 1004 | 1004 | ||
| 1005 | aes_dev = dd; | 1005 | aes_dev = dd; |
| 1006 | for (i = 0; i < ARRAY_SIZE(algs); i++) { | 1006 | for (i = 0; i < ARRAY_SIZE(algs); i++) { |
| 1007 | INIT_LIST_HEAD(&algs[i].cra_list); | ||
| 1008 | |||
| 1009 | algs[i].cra_priority = 300; | 1007 | algs[i].cra_priority = 300; |
| 1010 | algs[i].cra_ctxsize = sizeof(struct tegra_aes_ctx); | 1008 | algs[i].cra_ctxsize = sizeof(struct tegra_aes_ctx); |
| 1011 | algs[i].cra_module = THIS_MODULE; | 1009 | algs[i].cra_module = THIS_MODULE; |
