From patchwork Mon Nov 13 14:45:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 118803 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp1132342edl; Mon, 13 Nov 2017 06:48:13 -0800 (PST) X-Google-Smtp-Source: AGs4zMacdif7e/Xqq3zWNp5kr2ZzmbRSXYPmciPi+A4mysso5DV9+Hhj7c5Wd8LTbKiMZauu4tRe X-Received: by 10.99.103.5 with SMTP id b5mr9016885pgc.447.1510584493347; Mon, 13 Nov 2017 06:48:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510584493; cv=none; d=google.com; s=arc-20160816; b=Pxhvkywfloly6hgPubSoH+A2eR7bgALPLaPz5uLjolMdHoxwv8mb5xJzCcUH/g9a/H 8mvrD9epMtBL/glXBi3pR6LcOpxyURsrrJHTbSkPXjHi5eafyNKQIEuuyo2wgce8ec2t 7X8C7JDgYD3MI+j8usZbWvaYqZvW1Kfx8w7c3zMzmDxdhjhD9A+5zEGghbvR0Q6RV3kf 2ZZT9SZqY5+zPjS5TZ8qxOWFjWmSRZnXbXB039E9QBiett7rwak90uVK8sfy9Iv9fLiR 5R9mnJPTi9GxrS3iChZU3dzW0YngUuBsA1ZAF+pQrWuicLVUMnjmja53yx/HWbmt+ZGn Gbag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=9Gwq0s9Eh1ulQG8/BHKyEQ+1B/XMLrm6fiJzz82yqPQ=; b=Xznd37KMqHoq56SwVAP4aw352+MJ8dcZjuGO+V4ssICqTBvX2T+sfZ3+3JtEuYnRu+ 496bm2h7oUUvpv58R4bI/w90ItD8hdn6WSAEoZUAAMB5JSIW06pQO2iUPTGh22Un+Aen otPgWnW8vMBmmpJtNeqUlHlZ5kclz9n/SXirD0D049qNCeZ2clbqW7x15GAWN9OeeOP3 mwgC37OVv097naGBw9tpYdLcRJfDvj1iy9zFT3NutMYALdtrRKbIG3hxmCnP0k0rQpUS d1y6aUezk7j7QNU4dhI9XEYbvXkQ21hl8/lE053w4FWIsTlU0thNAJzkDmeZz9/CJ5Xa fzyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2si13492085pgt.268.2017.11.13.06.48.13; Mon, 13 Nov 2017 06:48:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753506AbdKMOsL (ORCPT + 27 others); Mon, 13 Nov 2017 09:48:11 -0500 Received: from foss.arm.com ([217.140.101.70]:47436 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752929AbdKMOsJ (ORCPT ); Mon, 13 Nov 2017 09:48:09 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D28BB1435; Mon, 13 Nov 2017 06:48:08 -0800 (PST) Received: from sugar.kfn.arm.com (unknown [10.45.48.133]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3FD563F318; Mon, 13 Nov 2017 06:48:07 -0800 (PST) From: Gilad Ben-Yossef To: Greg Kroah-Hartman Cc: Ofir Drang , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/24] staging: ccree: rename func for readability Date: Mon, 13 Nov 2017 14:45:46 +0000 Message-Id: <1510584358-29473-19-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510584358-29473-1-git-send-email-gilad@benyossef.com> References: <1510584358-29473-1-git-send-email-gilad@benyossef.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rename the insanely long ssi_ahash_get_larval_digest_sram_addr() func to cc_larval_digest_addr() for better code readability Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 7 +++---- drivers/staging/ccree/ssi_hash.c | 13 ++++++------- drivers/staging/ccree/ssi_hash.h | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) -- 2.7.4 diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c index e2cdf52..fcff625 100644 --- a/drivers/staging/ccree/ssi_aead.c +++ b/drivers/staging/ccree/ssi_aead.c @@ -336,8 +336,8 @@ static int hmac_setkey(struct cc_hw_desc *desc, struct ssi_aead_ctx *ctx) hw_desc_init(&desc[idx]); set_cipher_mode(&desc[idx], hash_mode); set_din_sram(&desc[idx], - ssi_ahash_get_larval_digest_sram_addr( - ctx->drvdata, ctx->auth_mode), + cc_larval_digest_addr(ctx->drvdata, + ctx->auth_mode), digest_size); set_flow_mode(&desc[idx], S_DIN_to_HASH); set_setup_mode(&desc[idx], SETUP_LOAD_STATE0); @@ -441,8 +441,7 @@ ssi_get_plain_hmac_key(struct crypto_aead *tfm, const u8 *key, dma_addr_t key_dma_addr = 0; struct ssi_aead_ctx *ctx = crypto_aead_ctx(tfm); struct device *dev = drvdata_to_dev(ctx->drvdata); - u32 larval_addr = ssi_ahash_get_larval_digest_sram_addr( - ctx->drvdata, ctx->auth_mode); + u32 larval_addr = cc_larval_digest_addr(ctx->drvdata, ctx->auth_mode); struct ssi_crypto_req ssi_req = {}; unsigned int blocksize; unsigned int digestsize; diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_hash.c index 4d7e565..0f67737 100644 --- a/drivers/staging/ccree/ssi_hash.c +++ b/drivers/staging/ccree/ssi_hash.c @@ -150,8 +150,8 @@ static int ssi_hash_map_request(struct device *dev, struct ssi_hash_ctx *ctx) { bool is_hmac = ctx->is_hmac; - ssi_sram_addr_t larval_digest_addr = ssi_ahash_get_larval_digest_sram_addr( - ctx->drvdata, ctx->hash_mode); + ssi_sram_addr_t larval_digest_addr = + cc_larval_digest_addr(ctx->drvdata, ctx->hash_mode); struct ssi_crypto_req ssi_req = {}; struct cc_hw_desc desc; int rc = -ENOMEM; @@ -438,8 +438,8 @@ static int ssi_hash_digest(struct ahash_req_ctx *state, bool is_hmac = ctx->is_hmac; struct ssi_crypto_req ssi_req = {}; struct cc_hw_desc desc[SSI_MAX_AHASH_SEQ_LEN]; - ssi_sram_addr_t larval_digest_addr = ssi_ahash_get_larval_digest_sram_addr( - ctx->drvdata, ctx->hash_mode); + ssi_sram_addr_t larval_digest_addr = + cc_larval_digest_addr(ctx->drvdata, ctx->hash_mode); int idx = 0; int rc = 0; @@ -1008,8 +1008,7 @@ static int ssi_hash_setkey(void *hash, blocksize = crypto_tfm_alg_blocksize(&((struct crypto_ahash *)hash)->base); digestsize = crypto_ahash_digestsize(((struct crypto_ahash *)hash)); - larval_addr = ssi_ahash_get_larval_digest_sram_addr( - ctx->drvdata, ctx->hash_mode); + larval_addr = cc_larval_digest_addr(ctx->drvdata, ctx->hash_mode); /* The keylen value distinguishes HASH in case keylen is ZERO bytes, * any NON-ZERO value utilizes HMAC flow @@ -2538,7 +2537,7 @@ static void ssi_hash_create_data_desc(struct ahash_req_ctx *areq_ctx, * * \return u32 The address of the initial digest in SRAM */ -ssi_sram_addr_t ssi_ahash_get_larval_digest_sram_addr(void *drvdata, u32 mode) +ssi_sram_addr_t cc_larval_digest_addr(void *drvdata, u32 mode) { struct ssi_drvdata *_drvdata = (struct ssi_drvdata *)drvdata; struct ssi_hash_handle *hash_handle = _drvdata->hash_handle; diff --git a/drivers/staging/ccree/ssi_hash.h b/drivers/staging/ccree/ssi_hash.h index 8e6eee5..32eb473 100644 --- a/drivers/staging/ccree/ssi_hash.h +++ b/drivers/staging/ccree/ssi_hash.h @@ -101,7 +101,7 @@ ssi_ahash_get_initial_digest_len_sram_addr(void *drvdata, u32 mode); * * \return u32 The address of the initial digest in SRAM */ -ssi_sram_addr_t ssi_ahash_get_larval_digest_sram_addr(void *drvdata, u32 mode); +ssi_sram_addr_t cc_larval_digest_addr(void *drvdata, u32 mode); #endif /*__SSI_HASH_H__*/