From patchwork Sat Jun 30 22:16:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10498445 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3491560532 for ; Sat, 30 Jun 2018 22:18:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23E2E28A52 for ; Sat, 30 Jun 2018 22:18:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 182D228DB8; Sat, 30 Jun 2018 22:18:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3C4028CFA for ; Sat, 30 Jun 2018 22:18:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869AbeF3WSj (ORCPT ); Sat, 30 Jun 2018 18:18:39 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:41804 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751778AbeF3WSi (ORCPT ); Sat, 30 Jun 2018 18:18:38 -0400 Received: by mail-pl0-f66.google.com with SMTP id w8-v6so6145830ply.8 for ; Sat, 30 Jun 2018 15:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2Ze7swtANarpcmrlznQvRDsUXzzdPxTTO95VwJj8JX4=; b=sMuvDTp+pW4g20mYYsmTDEI/CWD4/FhUCMi2Xp3HtHw22tb9TGlUqr8tJNk0o27U/L hNSNaCyItO3s1AtGAbmKAjWvIY7Jyamr890Ekl+6S6x3Zpd8Uu+9ijPjM7QwJEQB7UQP cG16imJXezzz5m1hdQNaUv1QEqjiz6yTMJjbZ/4yIczDF211FXcBwcH04973Q0kUG22j +eGe5baq5Lz4CInx/ZRIPM97wb6nfXSdwN9Q14lfHnY8Bq6zRjvo6bBO8IUGj1U3jESZ j3R/IwKZceauAYXmIdS3cJYpKNdZaaPklYdc9ATN2GesWbFkUQKZp3tR39L2jLySfkjm bwtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2Ze7swtANarpcmrlznQvRDsUXzzdPxTTO95VwJj8JX4=; b=S/5tFbUeXdJ673L1H5AES626tubokMgaI+81MsxtU+TBZUEI1STYhKfAMuewlFttJ2 SN80WuOv0blURO8chIWgeZtsehbDxie+VNoerVNyJTgdIr3fCVGO+Np/9OQn38xw3/GQ tCJ9MHD3PkLo3ZyG7VIKVAyKKfiaohIjSYDltLgccoNeFit6tX9f2waatMJn8KnjsXcc QwHPZ4YNSjJ5HQEdnyMS2r9mpm2qFMnhubNN2cibNzvh/AQ2FhQoVS8mWn4Zwqq9BvVC 3GEZ8xPpFmaKVYIsVyTDTaRMqeXEw03EZUkb9Nj4q1BUbqeM/9Jxnu+julgdLbWnmS9z ygmg== X-Gm-Message-State: APt69E01R2KX4UOPGCWsPAjCzkOXMGuqX65LAS4iEt2iRmA/A6LID4V5 dcU3QBTCyzqbDN+zIpJhElQiq3hb X-Google-Smtp-Source: ADUXVKIliMAUSj8ybBzlDaJb9UjW0fjT15TzhgEeKDg/7cgclB2wnkl4iVPcHdMf6XTHDgmU7VDNlA== X-Received: by 2002:a17:902:904c:: with SMTP id w12-v6mr20059865plz.34.1530397117591; Sat, 30 Jun 2018 15:18:37 -0700 (PDT) Received: from sol.localdomain (c-67-185-97-198.hsd1.wa.comcast.net. [67.185.97.198]) by smtp.gmail.com with ESMTPSA id g75-v6sm23636144pfg.145.2018.06.30.15.18.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Jun 2018 15:18:37 -0700 (PDT) From: Eric Biggers To: linux-crypto@vger.kernel.org, Herbert Xu Cc: Eric Biggers Subject: [PATCH 3/6] crypto: ahash - remove useless setting of cra_type Date: Sat, 30 Jun 2018 15:16:13 -0700 Message-Id: <20180630221616.31870-4-ebiggers3@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180630221616.31870-1-ebiggers3@gmail.com> References: <20180630221616.31870-1-ebiggers3@gmail.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers 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 Acked-by: Gilad Ben-Yossef --- arch/arm/crypto/ghash-ce-glue.c | 1 - arch/x86/crypto/ghash-clmulni-intel_glue.c | 1 - arch/x86/crypto/sha1-mb/sha1_mb.c | 1 - arch/x86/crypto/sha256-mb/sha256_mb.c | 1 - arch/x86/crypto/sha512-mb/sha512_mb.c | 1 - drivers/crypto/bcm/cipher.c | 1 - drivers/crypto/caam/caamhash.c | 1 - drivers/crypto/ccp/ccp-crypto-aes-cmac.c | 1 - drivers/crypto/ccp/ccp-crypto-sha.c | 1 - drivers/crypto/ccree/cc_hash.c | 1 - drivers/crypto/chelsio/chcr_algo.c | 1 - drivers/crypto/sunxi-ss/sun4i-ss-core.c | 2 -- drivers/crypto/talitos.c | 1 - drivers/crypto/ux500/hash/hash_core.c | 3 --- 14 files changed, 17 deletions(-) diff --git a/arch/arm/crypto/ghash-ce-glue.c b/arch/arm/crypto/ghash-ce-glue.c index 124fee03246e2..8930fc4e7c228 100644 --- a/arch/arm/crypto/ghash-ce-glue.c +++ b/arch/arm/crypto/ghash-ce-glue.c @@ -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, diff --git a/arch/x86/crypto/ghash-clmulni-intel_glue.c b/arch/x86/crypto/ghash-clmulni-intel_glue.c index a3de43b5e20a0..3582ae885ee11 100644 --- a/arch/x86/crypto/ghash-clmulni-intel_glue.c +++ b/arch/x86/crypto/ghash-clmulni-intel_glue.c @@ -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, diff --git a/arch/x86/crypto/sha1-mb/sha1_mb.c b/arch/x86/crypto/sha1-mb/sha1_mb.c index f7929ba6cfb43..b93805664c1dd 100644 --- a/arch/x86/crypto/sha1-mb/sha1_mb.c +++ b/arch/x86/crypto/sha1-mb/sha1_mb.c @@ -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, diff --git a/arch/x86/crypto/sha256-mb/sha256_mb.c b/arch/x86/crypto/sha256-mb/sha256_mb.c index 59a47048920ab..97c5fc43e115d 100644 --- a/arch/x86/crypto/sha256-mb/sha256_mb.c +++ b/arch/x86/crypto/sha256-mb/sha256_mb.c @@ -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), diff --git a/arch/x86/crypto/sha512-mb/sha512_mb.c b/arch/x86/crypto/sha512-mb/sha512_mb.c index d3a758ac3ade0..26b85678012d0 100644 --- a/arch/x86/crypto/sha512-mb/sha512_mb.c +++ b/arch/x86/crypto/sha512-mb/sha512_mb.c @@ -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), diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c index 2f85a989c4761..4e2babd6b89d7 100644 --- a/drivers/crypto/bcm/cipher.c +++ b/drivers/crypto/bcm/cipher.c @@ -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); diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index a20123e28ce6f..43975ab5f09c1 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c @@ -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; diff --git a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c index bdc2715b3cac9..3c6fe57f91f8c 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c +++ b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c @@ -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; diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sha.c index 366d3e914ac55..2ca64bb57d2eb 100644 --- a/drivers/crypto/ccp/ccp-crypto-sha.c +++ b/drivers/crypto/ccp/ccp-crypto-sha.c @@ -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; diff --git a/drivers/crypto/ccree/cc_hash.c b/drivers/crypto/ccree/cc_hash.c index 9cc7f8a95f96c..1da6cec2d9638 100644 --- a/drivers/crypto/ccree/cc_hash.c +++ b/drivers/crypto/ccree/cc_hash.c @@ -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; diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c index 6bbedf1bb7bda..915b1500393cd 100644 --- a/drivers/crypto/chelsio/chcr_algo.c +++ b/drivers/crypto/chelsio/chcr_algo.c @@ -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; diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-core.c b/drivers/crypto/sunxi-ss/sun4i-ss-core.c index d96bf75785698..1ff8fe684d310 100644 --- a/drivers/crypto/sunxi-ss/sun4i-ss-core.c +++ b/drivers/crypto/sunxi-ss/sun4i-ss-core.c @@ -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 } } diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 323b46d2457d9..6988012deca4c 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -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; diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index 7de22a646adff..daf4fed0df8ca 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -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, }