From patchwork Wed Jan 20 18:48:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 367073 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp744689jam; Wed, 20 Jan 2021 11:18:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3V21yhau+19BYs3pvl9XWX6XbED6606nuyxwHlY+IdGtCuiy1v7iVON7spBTpkpYqxA9/ X-Received: by 2002:a50:d491:: with SMTP id s17mr8297014edi.169.1611170284490; Wed, 20 Jan 2021 11:18:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611170284; cv=none; d=google.com; s=arc-20160816; b=OPUZem7XqYn/osW0DP+zrc4wVeH+WTN7NssQEiICD9gJwLgjtzsMywyldt+TrqNUcJ Pg8tEDoEheFZ/HPR1SooigjstLLcsgbHQY7AhmDz+olNWvMfZzA4awrAnaQOQGiJtwHV T5OJ1/5Fl36SwZuo92P7oo/6zM1STGSpRzLg5T0UNi0LvvsGqSXDKT0A2pdwDih/kMoQ G3AN1WyCg/OuGtBt3qEJLsb+3htFeqiv+9gHSEj28ADPK8o/qquDTwh9XjR3jxlMjqsq fN0z0zMqCU1oDgC7hBuOFLeEIsS5GL+he9Qr5v9B380K5HSxEEVZJn7TGNgsTfBlCXOO BOpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9Nywttu3tkLGv6x/bZ3lsaXiaIubIpPmLGtZ6J79D6I=; b=UPIA+ig1AKguxmssLTKtoVL59mDk60KaVsudCexzGVoSTwRye6i+HkpWNIsDOAXdai IkX7W7DMfGfxF5ItgO9mTc+14qPWz3evieEvHScOzP/dwjBz8hEmjcp5kZIGw6YR9KTg N1/JAPToSdCT9H74xgf15ekdbG+OPuQqld+XKoRY6X4BfaM/w5xMGXAzV2C/qRkF7mUC 6W2fPgqbnxD296Z7jXJmxx/tB/gNipQcgyedn3Wfbm0n95n4nbPUUChN+aWRf2eGIi29 z8Vmyz1NzuDZTZspRb5Gg7/Z8RbY5R2nSPuVebJp3khKU/1U9glGQ3y4UB3zGPKA9x6p FzkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EqXp77x4; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t12si1170850edw.420.2021.01.20.11.18.04; Wed, 20 Jan 2021 11:18:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EqXp77x4; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388162AbhATTQq (ORCPT + 2 others); Wed, 20 Jan 2021 14:16:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392223AbhATSvL (ORCPT ); Wed, 20 Jan 2021 13:51:11 -0500 Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91E10C06179B for ; Wed, 20 Jan 2021 10:48:52 -0800 (PST) Received: by mail-qt1-x835.google.com with SMTP id o18so7354198qtp.10 for ; Wed, 20 Jan 2021 10:48:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9Nywttu3tkLGv6x/bZ3lsaXiaIubIpPmLGtZ6J79D6I=; b=EqXp77x46oSyUZabaONZjdY8IVMaxDAoWuEWF79n7bvaRQtOyFXVZQYhfusUrgAXT/ VsguD1pdp6Knt20cxboMpZ8bk2LHPBOHdh5lsbTQk1Ikp6AUBw9dOS/o4t076cST3i6n cXgiKXMzmuda+zMf7oNNvcu2oqjldt/wKGGKTBO3wS0IokXKXvCN3W3ejpcg0JJI71Rg zqpSAhqQ1A49SutjW3QKLAXsBqDCU1WRRDWOQ/0oqx95YPNv8CXyPSiUOOnoI8vKm2ud Wy3NMhcDqiTOz4yEkXtKlwMb0nRJfTASYJ322e68XhAk2yV4hwmHqoFjntkkqCkc2r5c yrEg== 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:mime-version:content-transfer-encoding; bh=9Nywttu3tkLGv6x/bZ3lsaXiaIubIpPmLGtZ6J79D6I=; b=d1Q1rUkec6lIoAqi/lqMczcwfGxgKx3VqGrbL6bF4PIaO02oN1NYJqdrNJ1Fd97ZNe jI+CWShQUa9F0oTVX7LQnVayofdIkv8oj9uFgfEpAH6fGULfoc5Xs8acgiFz6cYCMahS hxVEHczpoAPI+dK+ERRlgami4KQm9E23QxfAxlA9Eclpg0z31xS8UbNqTezdTBDrfyyz l1t0Cu+i3AX3Z+HJj61vOU7gh0MjE4E+BtqLxu8eipT+wL/25Nz/Q14lj/D0N5laIEWv wmvrckhKmr9Ukgv1QPJWX4CzytADDJiIM2z3ni+OHX0L0PFRDZX0gWJkTPtRiaH4BpNJ wZqw== X-Gm-Message-State: AOAM5315Iqop9kGETqPyTlFBTymNXAg/wwNDxguj2K0IUEsVO9Yv6n01 TCfjUwQIEYskT6YmoVa9y9HymA== X-Received: by 2002:aed:3929:: with SMTP id l38mr10124717qte.352.1611168531800; Wed, 20 Jan 2021 10:48:51 -0800 (PST) Received: from pop-os.fios-router.home (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.googlemail.com with ESMTPSA id w8sm1769903qts.50.2021.01.20.10.48.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 10:48:51 -0800 (PST) From: Thara Gopinath To: herbert@gondor.apana.org.au, davem@davemloft.net, bjorn.andersson@linaro.org Cc: ebiggers@google.com, ardb@kernel.org, sivaprak@codeaurora.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/6] drivers: crypto: qce: Remove totallen and offset in qce_start Date: Wed, 20 Jan 2021 13:48:43 -0500 Message-Id: <20210120184843.3217775-7-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210120184843.3217775-1-thara.gopinath@linaro.org> References: <20210120184843.3217775-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org totallen is used to get the size of the data to be transformed. This is also available via nbytes or cryptlen in the qce_sha_reqctx and qce_cipher_ctx. Similarly offset convey nothing for the supported encryption and authentication transformations and is always 0. Remove these two redundant parameters in qce_start. Signed-off-by: Thara Gopinath --- drivers/crypto/qce/common.c | 17 +++++++---------- drivers/crypto/qce/common.h | 3 +-- drivers/crypto/qce/sha.c | 2 +- drivers/crypto/qce/skcipher.c | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) -- 2.25.1 Reviewed-by: Bjorn Andersson diff --git a/drivers/crypto/qce/common.c b/drivers/crypto/qce/common.c index f7bc701a4aa2..dceb9579d87a 100644 --- a/drivers/crypto/qce/common.c +++ b/drivers/crypto/qce/common.c @@ -140,8 +140,7 @@ static u32 qce_auth_cfg(unsigned long flags, u32 key_size) return cfg; } -static int qce_setup_regs_ahash(struct crypto_async_request *async_req, - u32 totallen, u32 offset) +static int qce_setup_regs_ahash(struct crypto_async_request *async_req) { struct ahash_request *req = ahash_request_cast(async_req); struct crypto_ahash *ahash = __crypto_ahash_cast(async_req->tfm); @@ -306,8 +305,7 @@ static void qce_xtskey(struct qce_device *qce, const u8 *enckey, qce_write(qce, REG_ENCR_XTS_DU_SIZE, cryptlen); } -static int qce_setup_regs_skcipher(struct crypto_async_request *async_req, - u32 totallen, u32 offset) +static int qce_setup_regs_skcipher(struct crypto_async_request *async_req) { struct skcipher_request *req = skcipher_request_cast(async_req); struct qce_cipher_reqctx *rctx = skcipher_request_ctx(req); @@ -367,7 +365,7 @@ static int qce_setup_regs_skcipher(struct crypto_async_request *async_req, qce_write(qce, REG_ENCR_SEG_CFG, encr_cfg); qce_write(qce, REG_ENCR_SEG_SIZE, rctx->cryptlen); - qce_write(qce, REG_ENCR_SEG_START, offset & 0xffff); + qce_write(qce, REG_ENCR_SEG_START, 0); if (IS_CTR(flags)) { qce_write(qce, REG_CNTR_MASK, ~0); @@ -376,7 +374,7 @@ static int qce_setup_regs_skcipher(struct crypto_async_request *async_req, qce_write(qce, REG_CNTR_MASK2, ~0); } - qce_write(qce, REG_SEG_SIZE, totallen); + qce_write(qce, REG_SEG_SIZE, rctx->cryptlen); /* get little endianness */ config = qce_config_reg(qce, 1); @@ -388,17 +386,16 @@ static int qce_setup_regs_skcipher(struct crypto_async_request *async_req, } #endif -int qce_start(struct crypto_async_request *async_req, u32 type, u32 totallen, - u32 offset) +int qce_start(struct crypto_async_request *async_req, u32 type) { switch (type) { #ifdef CONFIG_CRYPTO_DEV_QCE_SKCIPHER case CRYPTO_ALG_TYPE_SKCIPHER: - return qce_setup_regs_skcipher(async_req, totallen, offset); + return qce_setup_regs_skcipher(async_req); #endif #ifdef CONFIG_CRYPTO_DEV_QCE_SHA case CRYPTO_ALG_TYPE_AHASH: - return qce_setup_regs_ahash(async_req, totallen, offset); + return qce_setup_regs_ahash(async_req); #endif default: return -EINVAL; diff --git a/drivers/crypto/qce/common.h b/drivers/crypto/qce/common.h index 85ba16418a04..3bc244bcca2d 100644 --- a/drivers/crypto/qce/common.h +++ b/drivers/crypto/qce/common.h @@ -94,7 +94,6 @@ struct qce_alg_template { void qce_cpu_to_be32p_array(__be32 *dst, const u8 *src, unsigned int len); int qce_check_status(struct qce_device *qce, u32 *status); void qce_get_version(struct qce_device *qce, u32 *major, u32 *minor, u32 *step); -int qce_start(struct crypto_async_request *async_req, u32 type, u32 totallen, - u32 offset); +int qce_start(struct crypto_async_request *async_req, u32 type); #endif /* _COMMON_H_ */ diff --git a/drivers/crypto/qce/sha.c b/drivers/crypto/qce/sha.c index dd263c5e4dd8..a079e92b4e75 100644 --- a/drivers/crypto/qce/sha.c +++ b/drivers/crypto/qce/sha.c @@ -113,7 +113,7 @@ static int qce_ahash_async_req_handle(struct crypto_async_request *async_req) qce_dma_issue_pending(&qce->dma); - ret = qce_start(async_req, tmpl->crypto_alg_type, 0, 0); + ret = qce_start(async_req, tmpl->crypto_alg_type); if (ret) goto error_terminate; diff --git a/drivers/crypto/qce/skcipher.c b/drivers/crypto/qce/skcipher.c index d78b932441ab..a93fd3fd5f1a 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c @@ -143,7 +143,7 @@ qce_skcipher_async_req_handle(struct crypto_async_request *async_req) qce_dma_issue_pending(&qce->dma); - ret = qce_start(async_req, tmpl->crypto_alg_type, req->cryptlen, 0); + ret = qce_start(async_req, tmpl->crypto_alg_type); if (ret) goto error_terminate;