crypto: cleanup - remove unneeded crypto_alg.cra_list initializations
Jussi Kivilinna [Wed, 11 Jul 2012 11:20:46 +0000 (14:20 +0300)]
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/'.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

15 files changed:
crypto/aes_generic.c
crypto/anubis.c
crypto/blowfish_generic.c
crypto/camellia_generic.c
crypto/cast5.c
crypto/cast6.c
crypto/deflate.c
crypto/fcrypt.c
crypto/ghash-generic.c
crypto/khazad.c
crypto/krng.c
crypto/lzo.c
crypto/salsa20_generic.c
crypto/seed.c
crypto/twofish_generic.c

index a68c73d..47f2e5c 100644 (file)
@@ -1448,7 +1448,6 @@ static struct crypto_alg aes_alg = {
        .cra_ctxsize            =       sizeof(struct crypto_aes_ctx),
        .cra_alignmask          =       3,
        .cra_module             =       THIS_MODULE,
-       .cra_list               =       LIST_HEAD_INIT(aes_alg.cra_list),
        .cra_u                  =       {
                .cipher = {
                        .cia_min_keysize        =       AES_MIN_KEY_SIZE,
index 77530d5..008c8a4 100644 (file)
@@ -678,7 +678,6 @@ static struct crypto_alg anubis_alg = {
        .cra_ctxsize            =       sizeof (struct anubis_ctx),
        .cra_alignmask          =       3,
        .cra_module             =       THIS_MODULE,
-       .cra_list               =       LIST_HEAD_INIT(anubis_alg.cra_list),
        .cra_u                  =       { .cipher = {
        .cia_min_keysize        =       ANUBIS_MIN_KEY_SIZE,
        .cia_max_keysize        =       ANUBIS_MAX_KEY_SIZE,
index 6f269b5..8baf544 100644 (file)
@@ -115,7 +115,6 @@ static struct crypto_alg alg = {
        .cra_ctxsize            =       sizeof(struct bf_ctx),
        .cra_alignmask          =       3,
        .cra_module             =       THIS_MODULE,
-       .cra_list               =       LIST_HEAD_INIT(alg.cra_list),
        .cra_u                  =       { .cipher = {
        .cia_min_keysize        =       BF_MIN_KEY_SIZE,
        .cia_max_keysize        =       BF_MAX_KEY_SIZE,
index f7aaaaf..75efa20 100644 (file)
@@ -1072,7 +1072,6 @@ static struct crypto_alg camellia_alg = {
        .cra_ctxsize            =       sizeof(struct camellia_ctx),
        .cra_alignmask          =       3,
        .cra_module             =       THIS_MODULE,
-       .cra_list               =       LIST_HEAD_INIT(camellia_alg.cra_list),
        .cra_u                  =       {
                .cipher = {
                        .cia_min_keysize        =       CAMELLIA_MIN_KEY_SIZE,
index 4a230dd..fffcb37 100644 (file)
@@ -779,7 +779,6 @@ static struct crypto_alg alg = {
        .cra_ctxsize    = sizeof(struct cast5_ctx),
        .cra_alignmask  = 3,
        .cra_module     = THIS_MODULE,
-       .cra_list       = LIST_HEAD_INIT(alg.cra_list),
        .cra_u          = {
                .cipher = {
                        .cia_min_keysize = CAST5_MIN_KEY_SIZE,
index e0c15a6..04264f5 100644 (file)
@@ -519,7 +519,6 @@ static struct crypto_alg alg = {
        .cra_ctxsize = sizeof(struct cast6_ctx),
        .cra_alignmask = 3,
        .cra_module = THIS_MODULE,
-       .cra_list = LIST_HEAD_INIT(alg.cra_list),
        .cra_u = {
                  .cipher = {
                             .cia_min_keysize = CAST6_MIN_KEY_SIZE,
index b0165ec..b57d70e 100644 (file)
@@ -199,7 +199,6 @@ static struct crypto_alg alg = {
        .cra_flags              = CRYPTO_ALG_TYPE_COMPRESS,
        .cra_ctxsize            = sizeof(struct deflate_ctx),
        .cra_module             = THIS_MODULE,
-       .cra_list               = LIST_HEAD_INIT(alg.cra_list),
        .cra_init               = deflate_init,
        .cra_exit               = deflate_exit,
        .cra_u                  = { .compress = {
index c33107e..3b2cf56 100644 (file)
@@ -396,7 +396,6 @@ static struct crypto_alg fcrypt_alg = {
        .cra_ctxsize            =       sizeof(struct fcrypt_ctx),
        .cra_module             =       THIS_MODULE,
        .cra_alignmask          =       3,
-       .cra_list               =       LIST_HEAD_INIT(fcrypt_alg.cra_list),
        .cra_u                  =       { .cipher = {
        .cia_min_keysize        =       8,
        .cia_max_keysize        =       8,
index 7835b8f..9d3f0c6 100644 (file)
@@ -153,7 +153,6 @@ static struct shash_alg ghash_alg = {
                .cra_blocksize          = GHASH_BLOCK_SIZE,
                .cra_ctxsize            = sizeof(struct ghash_ctx),
                .cra_module             = THIS_MODULE,
-               .cra_list               = LIST_HEAD_INIT(ghash_alg.base.cra_list),
                .cra_exit               = ghash_exit_tfm,
        },
 };
index 527e4e3..60e7cd6 100644 (file)
@@ -853,7 +853,6 @@ static struct crypto_alg khazad_alg = {
        .cra_ctxsize            =       sizeof (struct khazad_ctx),
        .cra_alignmask          =       7,
        .cra_module             =       THIS_MODULE,
-       .cra_list               =       LIST_HEAD_INIT(khazad_alg.cra_list),
        .cra_u                  =       { .cipher = {
        .cia_min_keysize        =       KHAZAD_KEY_SIZE,
        .cia_max_keysize        =       KHAZAD_KEY_SIZE,
index 4328bb3..a2d2b72 100644 (file)
@@ -35,7 +35,6 @@ static struct crypto_alg krng_alg = {
        .cra_ctxsize            = 0,
        .cra_type               = &crypto_rng_type,
        .cra_module             = THIS_MODULE,
-       .cra_list               = LIST_HEAD_INIT(krng_alg.cra_list),
        .cra_u                  = {
                .rng = {
                        .rng_make_random        = krng_get_random,
index b5e7707..1c2aa69 100644 (file)
@@ -81,7 +81,6 @@ static struct crypto_alg alg = {
        .cra_flags              = CRYPTO_ALG_TYPE_COMPRESS,
        .cra_ctxsize            = sizeof(struct lzo_ctx),
        .cra_module             = THIS_MODULE,
-       .cra_list               = LIST_HEAD_INIT(alg.cra_list),
        .cra_init               = lzo_init,
        .cra_exit               = lzo_exit,
        .cra_u                  = { .compress = {
index eac10c1..9a4770c 100644 (file)
@@ -221,7 +221,6 @@ static struct crypto_alg alg = {
        .cra_ctxsize        =   sizeof(struct salsa20_ctx),
        .cra_alignmask      =   3,
        .cra_module         =   THIS_MODULE,
-       .cra_list           =   LIST_HEAD_INIT(alg.cra_list),
        .cra_u              =   {
                .blkcipher = {
                        .setkey         =   setkey,
index d3e422f..9c904d6 100644 (file)
@@ -449,7 +449,6 @@ static struct crypto_alg seed_alg = {
        .cra_ctxsize            =       sizeof(struct seed_ctx),
        .cra_alignmask          =       3,
        .cra_module             =       THIS_MODULE,
-       .cra_list               =       LIST_HEAD_INIT(seed_alg.cra_list),
        .cra_u                  =       {
                .cipher = {
                        .cia_min_keysize        =       SEED_KEY_SIZE,
index 1f07b84..2d50005 100644 (file)
@@ -188,7 +188,6 @@ static struct crypto_alg alg = {
        .cra_ctxsize        =   sizeof(struct twofish_ctx),
        .cra_alignmask      =   3,
        .cra_module         =   THIS_MODULE,
-       .cra_list           =   LIST_HEAD_INIT(alg.cra_list),
        .cra_u              =   { .cipher = {
        .cia_min_keysize    =   TF_MIN_KEY_SIZE,
        .cia_max_keysize    =   TF_MAX_KEY_SIZE,