crypto: ahash - remove useless setting of cra_type
authorEric Biggers <ebiggers@google.com>
Sat, 30 Jun 2018 22:16:13 +0000 (15:16 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 8 Jul 2018 16:30:26 +0000 (00:30 +0800)
Some ahash algorithms set .cra_type = &crypto_ahash_type.  But this is
redundant with the C structure type ('struct ahash_alg'), and
crypto_register_ahash() already sets the .cra_type automatically.
Apparently the useless assignment has just been copy+pasted around.

So, remove the useless assignment from all the ahash algorithms.

This patch shouldn't change any actual behavior.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
14 files changed:
arch/arm/crypto/ghash-ce-glue.c
arch/x86/crypto/ghash-clmulni-intel_glue.c
arch/x86/crypto/sha1-mb/sha1_mb.c
arch/x86/crypto/sha256-mb/sha256_mb.c
arch/x86/crypto/sha512-mb/sha512_mb.c
drivers/crypto/bcm/cipher.c
drivers/crypto/caam/caamhash.c
drivers/crypto/ccp/ccp-crypto-aes-cmac.c
drivers/crypto/ccp/ccp-crypto-sha.c
drivers/crypto/ccree/cc_hash.c
drivers/crypto/chelsio/chcr_algo.c
drivers/crypto/sunxi-ss/sun4i-ss-core.c
drivers/crypto/talitos.c
drivers/crypto/ux500/hash/hash_core.c

index 124fee03246e2cf9e7d90ad043fa31cd3f3f946e..8930fc4e7c228977f954c7a3062075df3f8a4757 100644 (file)
@@ -310,7 +310,6 @@ static struct ahash_alg ghash_async_alg = {
                .cra_priority   = 300,
                .cra_flags      = CRYPTO_ALG_ASYNC,
                .cra_blocksize  = GHASH_BLOCK_SIZE,
-               .cra_type       = &crypto_ahash_type,
                .cra_ctxsize    = sizeof(struct ghash_async_ctx),
                .cra_module     = THIS_MODULE,
                .cra_init       = ghash_async_init_tfm,
index a3de43b5e20a003d9a623daaa6c60de2f2083761..3582ae885ee11c04ea3e49f9c5dc77d0815d1202 100644 (file)
@@ -316,7 +316,6 @@ static struct ahash_alg ghash_async_alg = {
                        .cra_ctxsize            = sizeof(struct ghash_async_ctx),
                        .cra_flags              = CRYPTO_ALG_ASYNC,
                        .cra_blocksize          = GHASH_BLOCK_SIZE,
-                       .cra_type               = &crypto_ahash_type,
                        .cra_module             = THIS_MODULE,
                        .cra_init               = ghash_async_init_tfm,
                        .cra_exit               = ghash_async_exit_tfm,
index f7929ba6cfb435ad1a2998bf0620813de34a8323..b93805664c1dd0ad290e731bc145dfbcb33f5a1c 100644 (file)
@@ -880,7 +880,6 @@ static struct ahash_alg sha1_mb_async_alg = {
                        .cra_priority           = 50,
                        .cra_flags              = CRYPTO_ALG_ASYNC,
                        .cra_blocksize          = SHA1_BLOCK_SIZE,
-                       .cra_type               = &crypto_ahash_type,
                        .cra_module             = THIS_MODULE,
                        .cra_list               = LIST_HEAD_INIT(sha1_mb_async_alg.halg.base.cra_list),
                        .cra_init               = sha1_mb_async_init_tfm,
index 59a47048920abe85f80025ca9f6d75d4c35001c6..97c5fc43e115dac127e6f0681f881708691c413b 100644 (file)
@@ -879,7 +879,6 @@ static struct ahash_alg sha256_mb_async_alg = {
                        .cra_priority           = 50,
                        .cra_flags              = CRYPTO_ALG_ASYNC,
                        .cra_blocksize          = SHA256_BLOCK_SIZE,
-                       .cra_type               = &crypto_ahash_type,
                        .cra_module             = THIS_MODULE,
                        .cra_list               = LIST_HEAD_INIT
                                (sha256_mb_async_alg.halg.base.cra_list),
index d3a758ac3ade09b3a9aea185e7f20b6f1deb38c2..26b85678012d0f03a361c102e8444b916ff5f41b 100644 (file)
@@ -913,7 +913,6 @@ static struct ahash_alg sha512_mb_async_alg = {
                        .cra_priority           = 50,
                        .cra_flags              = CRYPTO_ALG_ASYNC,
                        .cra_blocksize          = SHA512_BLOCK_SIZE,
-                       .cra_type               = &crypto_ahash_type,
                        .cra_module             = THIS_MODULE,
                        .cra_list               = LIST_HEAD_INIT
                                (sha512_mb_async_alg.halg.base.cra_list),
index 2f85a989c4761e11f35a85a339645d84bda813e2..4e2babd6b89d755770a029f52639c072d341b041 100644 (file)
@@ -4648,7 +4648,6 @@ static int spu_register_ahash(struct iproc_alg_s *driver_alg)
        hash->halg.base.cra_ctxsize = sizeof(struct iproc_ctx_s);
        hash->halg.base.cra_init = ahash_cra_init;
        hash->halg.base.cra_exit = generic_cra_exit;
-       hash->halg.base.cra_type = &crypto_ahash_type;
        hash->halg.base.cra_flags = CRYPTO_ALG_ASYNC;
        hash->halg.statesize = sizeof(struct spu_hash_export_s);
 
index a20123e28ce6f1068395484e9562f98bc3c8bf93..43975ab5f09c12c391a8830da71584d76076dda8 100644 (file)
@@ -1847,7 +1847,6 @@ caam_hash_alloc(struct caam_hash_template *template,
        alg->cra_blocksize = template->blocksize;
        alg->cra_alignmask = 0;
        alg->cra_flags = CRYPTO_ALG_ASYNC;
-       alg->cra_type = &crypto_ahash_type;
 
        t_alg->alg_type = template->alg_type;
 
index bdc2715b3cac9110e48a3ce139d78497334e66b8..3c6fe57f91f8c0bb7cf21ce4d026c20ac50377d4 100644 (file)
@@ -405,7 +405,6 @@ int ccp_register_aes_cmac_algs(struct list_head *head)
        base->cra_blocksize = AES_BLOCK_SIZE;
        base->cra_ctxsize = sizeof(struct ccp_ctx);
        base->cra_priority = CCP_CRA_PRIORITY;
-       base->cra_type = &crypto_ahash_type;
        base->cra_init = ccp_aes_cmac_cra_init;
        base->cra_exit = ccp_aes_cmac_cra_exit;
        base->cra_module = THIS_MODULE;
index 366d3e914ac55140924d8011e964b1bee8dab8b9..2ca64bb57d2ebbb966ce5b7df2b0b12967bc701f 100644 (file)
@@ -503,7 +503,6 @@ static int ccp_register_sha_alg(struct list_head *head,
        base->cra_blocksize = def->block_size;
        base->cra_ctxsize = sizeof(struct ccp_ctx);
        base->cra_priority = CCP_CRA_PRIORITY;
-       base->cra_type = &crypto_ahash_type;
        base->cra_init = ccp_sha_cra_init;
        base->cra_exit = ccp_sha_cra_exit;
        base->cra_module = THIS_MODULE;
index 9cc7f8a95f96c8b7637d2d5c7c5d364ca00711a9..1da6cec2d9638dccfe923e19587b0913d1b22682 100644 (file)
@@ -1814,7 +1814,6 @@ static struct cc_hash_alg *cc_alloc_hash_alg(struct cc_hash_template *template,
 
        alg->cra_init = cc_cra_init;
        alg->cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_KERN_DRIVER_ONLY;
-       alg->cra_type = &crypto_ahash_type;
 
        t_crypto_alg->hash_mode = template->hash_mode;
        t_crypto_alg->hw_mode = template->hw_mode;
index 6bbedf1bb7bda87db03ba13386624065b17d7e22..915b1500393cd0a1e324f292a48653fc6af522e5 100644 (file)
@@ -4260,7 +4260,6 @@ static int chcr_register_alg(void)
                        a_hash->halg.base.cra_flags = CRYPTO_ALG_ASYNC;
                        a_hash->halg.base.cra_alignmask = 0;
                        a_hash->halg.base.cra_exit = NULL;
-                       a_hash->halg.base.cra_type = &crypto_ahash_type;
 
                        if (driver_algs[i].type == CRYPTO_ALG_TYPE_HMAC) {
                                a_hash->halg.base.cra_init = chcr_hmac_cra_init;
index d96bf75785698affeedf9245a9535e3270601105..1ff8fe684d310e95d7e2f610c2d88f6b8b68c188 100644 (file)
@@ -48,7 +48,6 @@ static struct sun4i_ss_alg_template ss_algs[] = {
                                .cra_blocksize = MD5_HMAC_BLOCK_SIZE,
                                .cra_ctxsize = sizeof(struct sun4i_req_ctx),
                                .cra_module = THIS_MODULE,
-                               .cra_type = &crypto_ahash_type,
                                .cra_init = sun4i_hash_crainit
                        }
                }
@@ -75,7 +74,6 @@ static struct sun4i_ss_alg_template ss_algs[] = {
                                .cra_blocksize = SHA1_BLOCK_SIZE,
                                .cra_ctxsize = sizeof(struct sun4i_req_ctx),
                                .cra_module = THIS_MODULE,
-                               .cra_type = &crypto_ahash_type,
                                .cra_init = sun4i_hash_crainit
                        }
                }
index 323b46d2457d95cfed7e9ab5f4ef42bf05327bb8..6988012deca4cdd8f0f2bc6dd21ca790e4c98f6a 100644 (file)
@@ -3174,7 +3174,6 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev,
                alg = &t_alg->algt.alg.hash.halg.base;
                alg->cra_init = talitos_cra_init_ahash;
                alg->cra_exit = talitos_cra_exit;
-               alg->cra_type = &crypto_ahash_type;
                t_alg->algt.alg.hash.init = ahash_init;
                t_alg->algt.alg.hash.update = ahash_update;
                t_alg->algt.alg.hash.final = ahash_final;
index 7de22a646adff787dd352a4db7d9bb0c2656082b..daf4fed0df8ca6c3ef320700a4b54f8683471b84 100644 (file)
@@ -1550,7 +1550,6 @@ static struct hash_algo_template hash_algs[] = {
                                .cra_flags = CRYPTO_ALG_ASYNC,
                                .cra_blocksize = SHA256_BLOCK_SIZE,
                                .cra_ctxsize = sizeof(struct hash_ctx),
-                               .cra_type = &crypto_ahash_type,
                                .cra_init = hash_cra_init,
                                .cra_module = THIS_MODULE,
                        }
@@ -1575,7 +1574,6 @@ static struct hash_algo_template hash_algs[] = {
                                .cra_flags = CRYPTO_ALG_ASYNC,
                                .cra_blocksize = SHA1_BLOCK_SIZE,
                                .cra_ctxsize = sizeof(struct hash_ctx),
-                               .cra_type = &crypto_ahash_type,
                                .cra_init = hash_cra_init,
                                .cra_module = THIS_MODULE,
                        }
@@ -1600,7 +1598,6 @@ static struct hash_algo_template hash_algs[] = {
                                .cra_flags = CRYPTO_ALG_ASYNC,
                                .cra_blocksize = SHA256_BLOCK_SIZE,
                                .cra_ctxsize = sizeof(struct hash_ctx),
-                               .cra_type = &crypto_ahash_type,
                                .cra_init = hash_cra_init,
                                .cra_module = THIS_MODULE,
                        }