Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp327520pxb; Wed, 3 Feb 2021 06:37:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDCaEz61Y1q/RVFOktNGYx2TSIsqk0KaI0jk/JovFnkcU3BHxyIMjluaxq+KqRXmoSGAZf X-Received: by 2002:a17:906:af6b:: with SMTP id os11mr3504752ejb.472.1612363023309; Wed, 03 Feb 2021 06:37:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612363023; cv=none; d=google.com; s=arc-20160816; b=XrR0tgWGuSrQ1uOC2hLnR03GxdvhtFoJWDviJhpbbR6AfBP/4ro1+C4FG8k0uhL+Rl EWmFiyLSKeWxcibyc9L8jJ1lrAgWFk9opXg9yI24mI81ZM88Tb02B6CA3WhSoV13LuLh xi/QnYd5731DUSmzZlHojqCsDSV1z3CWb0Zbnd/G365CJnal+oVFi9Anq81OkB+hH5QA 6iuwejg7Sh/7SiSQzaWkM/0TO5UBc19VeylP61v5n8+SBXcPoYimMmU60JRB8rIVoIIe 27LuIJZYwbo0XFGD/r2JvI6XpqFKVXSHhCEL1aZwohoQkDsuw4YbHcNTyDhobxJ81wYT tpHg== 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=+9ityeqdgyZLKc/rh27ogHO9y0MwsQMpPeavkRLsNvQ=; b=YEI7sLJkf4d2B2dyKx1Cx7fEfY8NRSU58IPFkVE7kf6kABUY8+3K14vBqj/TjBSYrY tQMu9BH46GCrlDtdE6r68wfBKC8hGqgPbDfRjykEAKpqJkux/nZghqSxFbum4A3wCpK9 l9+hozbkhzmEjJ92Ws/fQ5kEkmG0My9yN2gRWh3+p1h0Nqo0E2syccVI2VckXtfhP8d+ a6qyFf4JoKOBhp4KFItqFj8tY2Mu/cKut17e5OZ1aFxR7Q0bX9LT/z9xd4Ijqg9YZvTx bC7NlCcFFTW5B310pzcfuwXIlBdkiRabUrkDXhcmdlBjwI3uA4RXXhLTx28S1wrFlvGb CNZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mdHhx5CM; 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 bx1si1270799edb.603.2021.02.03.06.36.38; Wed, 03 Feb 2021 06:37:03 -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=mdHhx5CM; 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 S233033AbhBCOf2 (ORCPT + 99 others); Wed, 3 Feb 2021 09:35:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232791AbhBCOeu (ORCPT ); Wed, 3 Feb 2021 09:34:50 -0500 Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F25AC06121D for ; Wed, 3 Feb 2021 06:33:22 -0800 (PST) Received: by mail-qv1-xf33.google.com with SMTP id w11so11686354qvz.12 for ; Wed, 03 Feb 2021 06:33:22 -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=+9ityeqdgyZLKc/rh27ogHO9y0MwsQMpPeavkRLsNvQ=; b=mdHhx5CMghbS4mbIJhuv/jCQRTCD6rsp4Tu+mdekLjrwDJVgs98SNFcZihdRaRWxHu mySPOHRRNt6SHjC4nplIMJ3ZrNmk5BnoIZEJfyedrkc5cDtZckkFMKVKpYW22QTTITSS ChfjOHBjB47tnVfVNTA3Zorether7ASYW09kx5UC0994BQZ69/sIFmKg05Y3wg2tTyYv VMxV9ZV3eBW5bwiejboxbMrY9rRx6P4lVTIx5uRGafSq0LtF+0WFPhWpVuZAjPJpGlMR w5PmrnMqs2AUhhYNpzDHmSmRDd+tlfMT3svs9g3cwZzdpBZUPD6nlv4Q8jWR9wRTSdha oenw== 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=+9ityeqdgyZLKc/rh27ogHO9y0MwsQMpPeavkRLsNvQ=; b=UUcjFVp6jmdrHhMuJPrZ5XQ+kzH3wp2OBelgzJcu9bMPwQ8hm0ghgsxZCNcBWfHhyA Z4x5EBlyVmW2oykrgzzcoWu7yg1qaDopusTPWHz5+pT1HOKVErbeOjO2jiCK9xMRFrHE 7Jq4KXcKmPyz5cTc+x24TlcuXje83Gp6bzmsz+SzIawpNUF3dv1GiFwNy0bivkmYF8TE bnte8NAK1K2rXxHkbGGZ/+037/IPsL572mVL/QKrV99r69QQ5ohPo55kJwSLlERTgCSx SC6XvoFnuQ3sHmsk9IlZFDVEstFydIqEtdMLR4XsreoCUQOnwfBfEw2oS79tyy6xFZOG dKjA== X-Gm-Message-State: AOAM533dJQRRb6mXnwj/XbhESmLY1RslE+FCcOHltZoS5tgdID2BjgKm kD5PqtQJ9xgmBcbUzymcneNCkA== X-Received: by 2002:a0c:a99e:: with SMTP id a30mr2823309qvb.38.1612362800823; Wed, 03 Feb 2021 06:33:20 -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 v15sm1775433qkv.36.2021.02.03.06.33.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 06:33:20 -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 v4 11/11] crypto: qce: Remove totallen and offset in qce_start Date: Wed, 3 Feb 2021 09:33:07 -0500 Message-Id: <20210203143307.1351563-12-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210203143307.1351563-1-thara.gopinath@linaro.org> References: <20210203143307.1351563-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Reviewed-by: Bjorn Andersson 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(-) 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 c8bfa9db07b8..f6c6275272fc 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 8599250946b7..3fc0b263d498 100644 --- a/drivers/crypto/qce/skcipher.c +++ b/drivers/crypto/qce/skcipher.c @@ -144,7 +144,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; -- 2.25.1