Skip to content

Commit e15aa36

Browse files
jkivilinherbertx
authored andcommitted
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>
1 parent 7af6c24 commit e15aa36

12 files changed

Lines changed: 0 additions & 21 deletions

File tree

‎drivers/crypto/atmel-aes.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,6 @@ static int atmel_aes_register_algs(struct atmel_aes_dev *dd)
10171017
int err, i, j;
10181018

10191019
for (i = 0; i < ARRAY_SIZE(aes_algs); i++) {
1020-
INIT_LIST_HEAD(&aes_algs[i].cra_list);
10211020
err = crypto_register_alg(&aes_algs[i]);
10221021
if (err)
10231022
goto err_aes_algs;
@@ -1026,7 +1025,6 @@ static int atmel_aes_register_algs(struct atmel_aes_dev *dd)
10261025
atmel_aes_hw_version_init(dd);
10271026

10281027
if (dd->hw_version >= 0x130) {
1029-
INIT_LIST_HEAD(&aes_cfb64_alg[0].cra_list);
10301028
err = crypto_register_alg(&aes_cfb64_alg[0]);
10311029
if (err)
10321030
goto err_aes_cfb64_alg;

‎drivers/crypto/atmel-tdes.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,6 @@ static int atmel_tdes_register_algs(struct atmel_tdes_dev *dd)
10441044
int err, i, j;
10451045

10461046
for (i = 0; i < ARRAY_SIZE(tdes_algs); i++) {
1047-
INIT_LIST_HEAD(&tdes_algs[i].cra_list);
10481047
err = crypto_register_alg(&tdes_algs[i]);
10491048
if (err)
10501049
goto err_tdes_algs;

‎drivers/crypto/geode-aes.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ static struct crypto_alg geode_alg = {
289289
.cra_blocksize = AES_MIN_BLOCK_SIZE,
290290
.cra_ctxsize = sizeof(struct geode_aes_op),
291291
.cra_module = THIS_MODULE,
292-
.cra_list = LIST_HEAD_INIT(geode_alg.cra_list),
293292
.cra_u = {
294293
.cipher = {
295294
.cia_min_keysize = AES_MIN_KEY_SIZE,
@@ -402,7 +401,6 @@ static struct crypto_alg geode_cbc_alg = {
402401
.cra_alignmask = 15,
403402
.cra_type = &crypto_blkcipher_type,
404403
.cra_module = THIS_MODULE,
405-
.cra_list = LIST_HEAD_INIT(geode_cbc_alg.cra_list),
406404
.cra_u = {
407405
.blkcipher = {
408406
.min_keysize = AES_MIN_KEY_SIZE,
@@ -489,7 +487,6 @@ static struct crypto_alg geode_ecb_alg = {
489487
.cra_alignmask = 15,
490488
.cra_type = &crypto_blkcipher_type,
491489
.cra_module = THIS_MODULE,
492-
.cra_list = LIST_HEAD_INIT(geode_ecb_alg.cra_list),
493490
.cra_u = {
494491
.blkcipher = {
495492
.min_keysize = AES_MIN_KEY_SIZE,

‎drivers/crypto/nx/nx-aes-cbc.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ struct crypto_alg nx_cbc_aes_alg = {
127127
.cra_ctxsize = sizeof(struct nx_crypto_ctx),
128128
.cra_type = &crypto_blkcipher_type,
129129
.cra_module = THIS_MODULE,
130-
.cra_list = LIST_HEAD_INIT(nx_cbc_aes_alg.cra_list),
131130
.cra_init = nx_crypto_ctx_aes_cbc_init,
132131
.cra_exit = nx_crypto_ctx_exit,
133132
.cra_blkcipher = {

‎drivers/crypto/nx/nx-aes-ccm.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ struct crypto_alg nx_ccm_aes_alg = {
430430
.cra_ctxsize = sizeof(struct nx_crypto_ctx),
431431
.cra_type = &crypto_aead_type,
432432
.cra_module = THIS_MODULE,
433-
.cra_list = LIST_HEAD_INIT(nx_ccm_aes_alg.cra_list),
434433
.cra_init = nx_crypto_ctx_aes_ccm_init,
435434
.cra_exit = nx_crypto_ctx_exit,
436435
.cra_aead = {
@@ -453,7 +452,6 @@ struct crypto_alg nx_ccm4309_aes_alg = {
453452
.cra_ctxsize = sizeof(struct nx_crypto_ctx),
454453
.cra_type = &crypto_nivaead_type,
455454
.cra_module = THIS_MODULE,
456-
.cra_list = LIST_HEAD_INIT(nx_ccm4309_aes_alg.cra_list),
457455
.cra_init = nx_crypto_ctx_aes_ccm_init,
458456
.cra_exit = nx_crypto_ctx_exit,
459457
.cra_aead = {

‎drivers/crypto/nx/nx-aes-ctr.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ struct crypto_alg nx_ctr_aes_alg = {
141141
.cra_ctxsize = sizeof(struct nx_crypto_ctx),
142142
.cra_type = &crypto_blkcipher_type,
143143
.cra_module = THIS_MODULE,
144-
.cra_list = LIST_HEAD_INIT(nx_ctr_aes_alg.cra_list),
145144
.cra_init = nx_crypto_ctx_aes_ctr_init,
146145
.cra_exit = nx_crypto_ctx_exit,
147146
.cra_blkcipher = {
@@ -163,7 +162,6 @@ struct crypto_alg nx_ctr3686_aes_alg = {
163162
.cra_ctxsize = sizeof(struct nx_crypto_ctx),
164163
.cra_type = &crypto_blkcipher_type,
165164
.cra_module = THIS_MODULE,
166-
.cra_list = LIST_HEAD_INIT(nx_ctr3686_aes_alg.cra_list),
167165
.cra_init = nx_crypto_ctx_aes_ctr_init,
168166
.cra_exit = nx_crypto_ctx_exit,
169167
.cra_blkcipher = {

‎drivers/crypto/nx/nx-aes-ecb.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ struct crypto_alg nx_ecb_aes_alg = {
126126
.cra_ctxsize = sizeof(struct nx_crypto_ctx),
127127
.cra_type = &crypto_blkcipher_type,
128128
.cra_module = THIS_MODULE,
129-
.cra_list = LIST_HEAD_INIT(nx_ecb_aes_alg.cra_list),
130129
.cra_init = nx_crypto_ctx_aes_ecb_init,
131130
.cra_exit = nx_crypto_ctx_exit,
132131
.cra_blkcipher = {

‎drivers/crypto/nx/nx-aes-gcm.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ struct crypto_alg nx_gcm_aes_alg = {
316316
.cra_ctxsize = sizeof(struct nx_crypto_ctx),
317317
.cra_type = &crypto_aead_type,
318318
.cra_module = THIS_MODULE,
319-
.cra_list = LIST_HEAD_INIT(nx_gcm_aes_alg.cra_list),
320319
.cra_init = nx_crypto_ctx_aes_gcm_init,
321320
.cra_exit = nx_crypto_ctx_exit,
322321
.cra_aead = {
@@ -338,7 +337,6 @@ struct crypto_alg nx_gcm4106_aes_alg = {
338337
.cra_ctxsize = sizeof(struct nx_crypto_ctx),
339338
.cra_type = &crypto_nivaead_type,
340339
.cra_module = THIS_MODULE,
341-
.cra_list = LIST_HEAD_INIT(nx_gcm4106_aes_alg.cra_list),
342340
.cra_init = nx_crypto_ctx_aes_gcm_init,
343341
.cra_exit = nx_crypto_ctx_exit,
344342
.cra_aead = {

‎drivers/crypto/omap-aes.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,6 @@ static int omap_aes_probe(struct platform_device *pdev)
876876

877877
for (i = 0; i < ARRAY_SIZE(algs); i++) {
878878
pr_debug("i: %d\n", i);
879-
INIT_LIST_HEAD(&algs[i].cra_list);
880879
err = crypto_register_alg(&algs[i]);
881880
if (err)
882881
goto err_algs;

‎drivers/crypto/padlock-aes.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,6 @@ static struct crypto_alg aes_alg = {
328328
.cra_ctxsize = sizeof(struct aes_ctx),
329329
.cra_alignmask = PADLOCK_ALIGNMENT - 1,
330330
.cra_module = THIS_MODULE,
331-
.cra_list = LIST_HEAD_INIT(aes_alg.cra_list),
332331
.cra_u = {
333332
.cipher = {
334333
.cia_min_keysize = AES_MIN_KEY_SIZE,
@@ -408,7 +407,6 @@ static struct crypto_alg ecb_aes_alg = {
408407
.cra_alignmask = PADLOCK_ALIGNMENT - 1,
409408
.cra_type = &crypto_blkcipher_type,
410409
.cra_module = THIS_MODULE,
411-
.cra_list = LIST_HEAD_INIT(ecb_aes_alg.cra_list),
412410
.cra_u = {
413411
.blkcipher = {
414412
.min_keysize = AES_MIN_KEY_SIZE,
@@ -491,7 +489,6 @@ static struct crypto_alg cbc_aes_alg = {
491489
.cra_alignmask = PADLOCK_ALIGNMENT - 1,
492490
.cra_type = &crypto_blkcipher_type,
493491
.cra_module = THIS_MODULE,
494-
.cra_list = LIST_HEAD_INIT(cbc_aes_alg.cra_list),
495492
.cra_u = {
496493
.blkcipher = {
497494
.min_keysize = AES_MIN_KEY_SIZE,

0 commit comments

Comments
 (0)