Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2621841pxu; Fri, 18 Dec 2020 19:33:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlR13/vjEh8YrxiUH4Ad6GvQbAbqU+WBBwgwwxdXZyHoQiEm5J7vKFamO2wF84sBji5I3B X-Received: by 2002:a17:906:a8e:: with SMTP id y14mr6854992ejf.47.1608348782548; Fri, 18 Dec 2020 19:33:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608348782; cv=none; d=google.com; s=arc-20160816; b=HjF6z0yVfKRdj46SetcHtKXBERU6nnKKNMTJaYafw7lPcJ5IRALUuFe324dKm9VB5+ Bzhxn2jvOVSawnCtds1tYv51W16nEAs1za1Lb+23OT6jQ0zjKd629A5YikJfDhGDLsFu K34Fa3rC+8UkC1sadtr0caRlgoYPa3G3miqhgLIWnmD/bbnkGjfFcgXOF1ksGtsDZBpt XyJGLaEmd3iv+6XpCJSIY+GuV7KxcdcLSkytCpXVvYQxdxKZPDGUzf+p63aOBrCzbjwH sdz/exOkTC59oEDqP+ZO4OlphfX9k0RqT4vOdG2bwxVZ5mTBAsAfenxaeEap4seRlDFA Iwkw== 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=vm+9qcF9rEIBSxmXyE4c8CtzzHn6VqYs01p3AiQrvhM=; b=KUP12ecoiYBNpnk9LuqWleXKY6/ouZNmmEjkvV3Zjbip36hYNRwSvTey6qYfFBmPre HFdD9RLeHbAVvZrar7MA79mZ9ZVYYlZZ7Symcd0RDmQXUYd7AYSsVY8zL7DXS7I9/B0C tKKWQGrZuF66WvUlGS4FMzyp58VdEhq+mIHiBaDJicEu4vzqxEbqlz8IhmAUVgnAVT/y qYzHT+/JPhtv6CtIOEcMl/A5d/TNhcTiZWRZsx5/ozMPEnlUL2SvEp99jlbWDuCPwitV c7AInbmKm5qdkUDhbFUUbjSUrxkzCAgFrwZCIyAN7Qk0RnOS9FdQ6clihmRXjs9SpoCT sGvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WmRig25O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 y23si5709971ejw.283.2020.12.18.19.32.40; Fri, 18 Dec 2020 19:33:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=WmRig25O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726544AbgLSDb4 (ORCPT + 99 others); Fri, 18 Dec 2020 22:31:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726109AbgLSDbw (ORCPT ); Fri, 18 Dec 2020 22:31:52 -0500 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41DBBC0611D0 for ; Fri, 18 Dec 2020 19:30:36 -0800 (PST) Received: by mail-qt1-x82f.google.com with SMTP id j26so2888006qtq.8 for ; Fri, 18 Dec 2020 19:30:36 -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=vm+9qcF9rEIBSxmXyE4c8CtzzHn6VqYs01p3AiQrvhM=; b=WmRig25OaCsRJ99xFfK78CHrKjJIOl6awPj8EWWovr/HiqgKw+BM3VA4F781QEXA6N zKJpgC6gCIZv4Y0IU/w6pCQ75INjpeNX5+QwGFMiaxcbU8HdoCxteLafRGMa+Dl8B3E3 LzCUo4k0ZhFn2FeAl0CLQKk5kTtpCoWxaksrQ8PELgRYyWKMa3UhMWEgF7cte9kBEJil lTlz74K9NhUUN8/vfKPEEy9b+mkCfINIOqMXkPN2GSthb542YqC/jrO2NJ7YtuIzQgCU auJi3hknIu4lhzEOkAV/gomLjCsHALqjbCkYEUSwDGJrOm4vFh6j0PUSINi1TdYbD3y6 FTvw== 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=vm+9qcF9rEIBSxmXyE4c8CtzzHn6VqYs01p3AiQrvhM=; b=fA/mmQHztoq26zGc03MCZah9sZkkFo/j0Q8T/5RUk6v4GWQSN2uDlLMkfGJ763/sOC loQ2XWUio1UzXiBUdNfAioYzTUkCd6wk2Ae6YNh5K5ja1Tct5P+imyBqrCltApxciGC/ /5n/SxC4EClv2pP+WPSTTEjWRWi4R+32GGKCjMezffENULM5/IZwtOx3MhPEQzwHQYJh bpa9r5k88PzShdOIpEBYpLAzV1ubfLkeOD3xTYJjes2ecMDxMXtV4MjPRdCGN4IBoabv 93tzAVabCXtEy87ldAdmq6zUmPHCfiW36tWRZtKah0XluZtdenBfE4Q507jt0KLYV/vL z+Ng== X-Gm-Message-State: AOAM533s3R8zr7HCkIEWtMkEYtxkRzT7ly6S8xnB3D06ManuVJvDP8AL rVn0LVCtPmyM/hbbnmxkTupYxQ== X-Received: by 2002:ac8:6f77:: with SMTP id u23mr7328806qtv.118.1608348635518; Fri, 18 Dec 2020 19:30:35 -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 y16sm4376045qki.132.2020.12.18.19.30.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 19:30:34 -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 6/6] drivers: crypto: qce: Remove totallen and offset in qce_start Date: Fri, 18 Dec 2020 22:30:27 -0500 Message-Id: <20201219033027.3066042-7-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201219033027.3066042-1-thara.gopinath@linaro.org> References: <20201219033027.3066042-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) diff --git a/drivers/crypto/qce/common.c b/drivers/crypto/qce/common.c index 7ae0b779563f..e292d8453ef6 100644 --- a/drivers/crypto/qce/common.c +++ b/drivers/crypto/qce/common.c @@ -139,8 +139,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); @@ -305,8 +304,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); @@ -366,7 +364,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); @@ -375,7 +373,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); @@ -387,17 +385,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 02d89267a806..141cfe14574d 100644 --- a/drivers/crypto/qce/sha.c +++ b/drivers/crypto/qce/sha.c @@ -107,7 +107,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 936bfb7c769b..2f327640b4de 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; -- 2.25.1