From: Gilad Ben-Yossef <gilad@benyossef.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Ofir Drang <ofir.drang@arm.com>, linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 20/24] staging: ccree: remove unneeded wrapper function Date: Mon, 13 Nov 2017 14:45:48 +0000 [thread overview] Message-ID: <1510584358-29473-21-git-send-email-gilad@benyossef.com> (raw) In-Reply-To: <1510584358-29473-1-git-send-email-gilad@benyossef.com> Remove unneeded wrapper function to simplify code. Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> --- drivers/staging/ccree/ssi_hash.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c index afdc44e..a2e8a9d 100644 --- a/drivers/staging/ccree/ssi_hash.c +++ b/drivers/staging/ccree/ssi_hash.c @@ -986,10 +986,8 @@ static int ssi_hash_init(struct ahash_req_ctx *state, struct ssi_hash_ctx *ctx) return 0; } -static int ssi_hash_setkey(void *hash, - const u8 *key, - unsigned int keylen, - bool synchronize) +static int ssi_ahash_setkey(struct crypto_ahash *ahash, const u8 *key, + unsigned int keylen) { unsigned int hmac_pad_const[2] = { HMAC_IPAD_CONST, HMAC_OPAD_CONST }; struct ssi_crypto_req ssi_req = {}; @@ -1001,12 +999,12 @@ static int ssi_hash_setkey(void *hash, ssi_sram_addr_t larval_addr; struct device *dev; - ctx = crypto_ahash_ctx(((struct crypto_ahash *)hash)); + ctx = crypto_ahash_ctx(ahash); dev = drvdata_to_dev(ctx->drvdata); dev_dbg(dev, "start keylen: %d", keylen); - blocksize = crypto_tfm_alg_blocksize(&((struct crypto_ahash *)hash)->base); - digestsize = crypto_ahash_digestsize(((struct crypto_ahash *)hash)); + blocksize = crypto_tfm_alg_blocksize(&ahash->base); + digestsize = crypto_ahash_digestsize(ahash); larval_addr = cc_larval_digest_addr(ctx->drvdata, ctx->hash_mode); @@ -1167,8 +1165,7 @@ static int ssi_hash_setkey(void *hash, out: if (rc) - crypto_ahash_set_flags((struct crypto_ahash *)hash, - CRYPTO_TFM_RES_BAD_KEY_LEN); + crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_KEY_LEN); if (ctx->key_params.key_dma_addr) { dma_unmap_single(dev, ctx->key_params.key_dma_addr, @@ -1879,12 +1876,6 @@ static int ssi_ahash_import(struct ahash_request *req, const void *in) return rc; } -static int ssi_ahash_setkey(struct crypto_ahash *ahash, - const u8 *key, unsigned int keylen) -{ - return ssi_hash_setkey((void *)ahash, key, keylen, false); -} - struct ssi_hash_template { char name[CRYPTO_MAX_ALG_NAME]; char driver_name[CRYPTO_MAX_ALG_NAME]; -- 2.7.4
WARNING: multiple messages have this Message-ID (diff)
From: Gilad Ben-Yossef <gilad@benyossef.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, driverdev-devel@linuxdriverproject.org, linux-crypto@vger.kernel.org, Ofir Drang <ofir.drang@arm.com> Subject: [PATCH 20/24] staging: ccree: remove unneeded wrapper function Date: Mon, 13 Nov 2017 14:45:48 +0000 [thread overview] Message-ID: <1510584358-29473-21-git-send-email-gilad@benyossef.com> (raw) In-Reply-To: <1510584358-29473-1-git-send-email-gilad@benyossef.com> Remove unneeded wrapper function to simplify code. Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> --- drivers/staging/ccree/ssi_hash.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c index afdc44e..a2e8a9d 100644 --- a/drivers/staging/ccree/ssi_hash.c +++ b/drivers/staging/ccree/ssi_hash.c @@ -986,10 +986,8 @@ static int ssi_hash_init(struct ahash_req_ctx *state, struct ssi_hash_ctx *ctx) return 0; } -static int ssi_hash_setkey(void *hash, - const u8 *key, - unsigned int keylen, - bool synchronize) +static int ssi_ahash_setkey(struct crypto_ahash *ahash, const u8 *key, + unsigned int keylen) { unsigned int hmac_pad_const[2] = { HMAC_IPAD_CONST, HMAC_OPAD_CONST }; struct ssi_crypto_req ssi_req = {}; @@ -1001,12 +999,12 @@ static int ssi_hash_setkey(void *hash, ssi_sram_addr_t larval_addr; struct device *dev; - ctx = crypto_ahash_ctx(((struct crypto_ahash *)hash)); + ctx = crypto_ahash_ctx(ahash); dev = drvdata_to_dev(ctx->drvdata); dev_dbg(dev, "start keylen: %d", keylen); - blocksize = crypto_tfm_alg_blocksize(&((struct crypto_ahash *)hash)->base); - digestsize = crypto_ahash_digestsize(((struct crypto_ahash *)hash)); + blocksize = crypto_tfm_alg_blocksize(&ahash->base); + digestsize = crypto_ahash_digestsize(ahash); larval_addr = cc_larval_digest_addr(ctx->drvdata, ctx->hash_mode); @@ -1167,8 +1165,7 @@ static int ssi_hash_setkey(void *hash, out: if (rc) - crypto_ahash_set_flags((struct crypto_ahash *)hash, - CRYPTO_TFM_RES_BAD_KEY_LEN); + crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_KEY_LEN); if (ctx->key_params.key_dma_addr) { dma_unmap_single(dev, ctx->key_params.key_dma_addr, @@ -1879,12 +1876,6 @@ static int ssi_ahash_import(struct ahash_request *req, const void *in) return rc; } -static int ssi_ahash_setkey(struct crypto_ahash *ahash, - const u8 *key, unsigned int keylen) -{ - return ssi_hash_setkey((void *)ahash, key, keylen, false); -} - struct ssi_hash_template { char name[CRYPTO_MAX_ALG_NAME]; char driver_name[CRYPTO_MAX_ALG_NAME]; -- 2.7.4 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2017-11-13 14:45 UTC|newest] Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-11-13 14:45 [PATCH 00/24] staging: ccree: more cleanup patches Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 01/24] staging: ccree: fix typos Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 02/24] staging: ccree: alloc by instance not type Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 03/24] staging: ccree: remove unnecessary parentheses Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 04/24] staging: ccree: remove MIN/MAX macros Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 05/24] staging: ccree: move logical cont. to 1st line Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 06/24] staging: ccree: remove unneeded empty lines Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 07/24] staging: ccree: remove unneeded cast Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 15:41 ` Joe Perches 2017-11-13 15:41 ` Joe Perches 2017-11-14 9:30 ` Gilad Ben-Yossef 2017-11-14 9:30 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 08/24] staging: ccree: make mem barrier per request Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 09/24] staging: ccree: replace open coded loop with for Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 10/24] staging: ccree: document spinlock usage Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 11/24] staging: ccree: constify help string Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 12/24] staging: ccree: fix code indent Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 13/24] staging: ccree: Replace CONFIG_PM_RUNTIME with CONFIG_PM Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 14/24] staging: ccree: replace macro with inline func Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 15/24] staging: ccree: trim long lines for readability Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 16/24] staging: ccree: remove dead defs and decls Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 17/24] staging: ccree: refactor code with local vars Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 18/24] staging: ccree: rename func for readability Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 19/24] staging: ccree: rename long define " Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef [this message] 2017-11-13 14:45 ` [PATCH 20/24] staging: ccree: remove unneeded wrapper function Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 21/24] staging: ccree: remove unused field Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 22/24] staging: ccree: replace msleep with a completion Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 23/24] staging: ccree: use local vars for readability Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` [PATCH 24/24] staging: ccree: drop unused macro Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 14:45 ` Gilad Ben-Yossef 2017-11-13 18:33 ` [PATCH 00/24] staging: ccree: more cleanup patches Dan Carpenter 2017-11-13 18:33 ` Dan Carpenter 2017-11-13 18:33 ` Dan Carpenter 2017-11-14 9:33 ` Gilad Ben-Yossef 2017-11-14 9:33 ` Gilad Ben-Yossef 2017-11-14 9:48 ` Dan Carpenter 2017-11-14 9:48 ` Dan Carpenter 2017-11-15 6:35 ` Gilad Ben-Yossef
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1510584358-29473-21-git-send-email-gilad@benyossef.com \ --to=gilad@benyossef.com \ --cc=devel@driverdev.osuosl.org \ --cc=driverdev-devel@linuxdriverproject.org \ --cc=gregkh@linuxfoundation.org \ --cc=linux-crypto@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=ofir.drang@arm.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.