Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3167235pxb; Mon, 25 Jan 2021 08:37:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0DxVdhmjKDAPfPjn/dl/tVrtg4eAMPv0VMPPCKTM5dEs6ST1IR2A5lvD7oO0Wy77FOnyx X-Received: by 2002:a50:da8b:: with SMTP id q11mr1231693edj.352.1611592655161; Mon, 25 Jan 2021 08:37:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611592655; cv=none; d=google.com; s=arc-20160816; b=mcB7mrwx2JYdMNeuS/rGTB4HTt+rLole0ILHyfwauSZUjTyWPyKZikVnWhoixImv66 BpfWmLvw/EcGVlj1DVDhqsnneqCeXXIl1YF7994IKQkndEIWosuj2GFOcCLto21LiAWG ZrVBJPsQvreBm3ehSv9NuZjqR5cDtW03JVueRJ6nMoqcvOkbs9tA8Yp05Qx7Mnoiax95 jt/EfXXeAc2/4C+2FR4mMdhX4tvP7za1ux+TMnUDpk2ZxGMdQFWH+P3Jy/LB3ZBg1HQb gmXB+0Ku6O8tpa/xbNGXFJA//ym+IkXldfHNtMAnce/UtdaAUoFsS0g2BQCjZCXpmZce boIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IzcX4KEe4k8MwWgjN00hmk2HbqHi/ERZ8/ypGsuqBDk=; b=gVbNuDHuwiXz6KtC0j98bhBp3ylzXRe11IvILa5BsqRxH2l8EC3ujuB5ybzViwPyc/ MUONnkyjOpfc1NbT+TcwV2mFrezFkUPiYkzN11RqUx/QaLksLQyEgs/EnaqMYgxWx03N 7BK1vnoqlcqDMIgsecqFNDs/Ak3LxLdpfeFvGQ3vFqfWdRDH5Z9X/IvkmCQ7Xz8nFeWy 7MN+KSXKKZDKSik0mSReO6Fw59WygsO1sZtiamrI22nOLNcbeBeJaDaWMxQfiMWDt9Y0 hKO3vpsnnt3PRCcXpAVxMfP3lkrvZJ38Uumi+gkRhyxVgdi7wj1ESe8D9dDj/gMJak8d n3IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="jCrVnRF/"; 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 y12si6906277edv.604.2021.01.25.08.37.11; Mon, 25 Jan 2021 08:37:35 -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="jCrVnRF/"; 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 S1730776AbhAYQfQ (ORCPT + 99 others); Mon, 25 Jan 2021 11:35:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730778AbhAYQfG (ORCPT ); Mon, 25 Jan 2021 11:35:06 -0500 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 232B0C06178A for ; Mon, 25 Jan 2021 08:34:26 -0800 (PST) Received: by mail-oi1-x229.google.com with SMTP id d18so6039315oic.3 for ; Mon, 25 Jan 2021 08:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=IzcX4KEe4k8MwWgjN00hmk2HbqHi/ERZ8/ypGsuqBDk=; b=jCrVnRF/Q9ht2J9+rWWhrEp1DmYm2wmHsI8fUBG5rkbxf5DIA05mLLazPfp+ntr71c u+EiOz1X/dn0Xvc8l1qYNLQMShek63SveoofT4JxP7KCg0Cr0NZCpJNO3WJtIChaDRq5 HH6FSjuBC9JvZrZmmNAvAvHOHC4Gr2x1Paj2+KoUTmHexp2ggr2Sry7jfPCC9jO/KWkd Kb1KCYiBcpksswv7Kg9Vgi7jRlS0N3UPU7d851bxveDCJEnGSftzca8w/6aIr+yof1EK 5a6CwkcIEiBW7l/5XMawgMlVzUsBoGR8VkByfYFyLBHD48QN2ewy8FiJOwoO4600/YCa fz9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=IzcX4KEe4k8MwWgjN00hmk2HbqHi/ERZ8/ypGsuqBDk=; b=WimaskxqzVo9A8IG389/XEu0Ty5ZSVKRlUCqKhtPm+5PenqiuHLLM4xm5/k5UaKxZv 5byYb4Yu1OxrOyfFjoMG/0970FXBxXwemqdegiHTZ0EahxwTC0nliA0xlva02sCwRcKc uDrEeJKj71Z4I5nhfJWbiZRESgGq1jf6LuqMZ2/5J4dJ1LHJB0RptZwdMb1b1jvw+QYD V7Bcqv0cMFMaLMTRjstijIDk4HD13PvCzv8SUEfssR7ZzZKv0Px7MaUo8fIQImGz26pq QcrDcxnyfOj1SS/VULyKuBQtH6vvK43B8c8tbuMmUxV+eVzENNBgof6QtmeOQIXuHCVh z9Yw== X-Gm-Message-State: AOAM533JK9c2JBfOdl52FamvfypkluZXlhePLSfYr8x2OHp5FLpV5P1P /AG0052jZkFF7cJmgJxLNjXZTOH2RTumSg== X-Received: by 2002:aca:add7:: with SMTP id w206mr643177oie.86.1611592465558; Mon, 25 Jan 2021 08:34:25 -0800 (PST) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id q26sm2389731otn.67.2021.01.25.08.34.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 08:34:24 -0800 (PST) Date: Mon, 25 Jan 2021 10:34:23 -0600 From: Bjorn Andersson To: Thara Gopinath Cc: herbert@gondor.apana.org.au, davem@davemloft.net, ebiggers@google.com, ardb@kernel.org, sivaprak@codeaurora.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 6/6] drivers: crypto: qce: Remove totallen and offset in qce_start Message-ID: References: <20210120184843.3217775-1-thara.gopinath@linaro.org> <20210120184843.3217775-7-thara.gopinath@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210120184843.3217775-7-thara.gopinath@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed 20 Jan 12:48 CST 2021, Thara Gopinath wrote: > 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. > Please drop "drivers: " from $subject. Reviewed-by: Bjorn Andersson Regards, Bjorn > 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 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; > > -- > 2.25.1 >