From patchwork Tue Nov 7 09:39:59 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: 118129 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3757164qgn; Tue, 7 Nov 2017 01:40:39 -0800 (PST) X-Google-Smtp-Source: ABhQp+Qe9MTcD8dhjT8M/bY/v8v2bgb19FVf2rmoJSIRmPq8UvNVUZP1QTJDiWHwvdoDmdjiXiOU X-Received: by 10.98.24.80 with SMTP id 77mr20137884pfy.195.1510047639121; Tue, 07 Nov 2017 01:40:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510047639; cv=none; d=google.com; s=arc-20160816; b=dt/Hx65q/vhWk2ChDmogL9QUb1LGNmh8AroyuA20HeWS0pKSV60S4xO1TgU7RG6RJ5 OSeYcm0jev/nwn5shdNWcnRA9VjTvXEHaEVf/AocayWKcPJ2dxEM7jtooLMVaCWvx7f6 Y5zOgYfrg6MdjulfAN34ewkO2jxMnVl7av+NbA97Q912ngdvWLgqYlVKwpCSX22aKEmO YLs1w11oqezmfEQk0/gsyaPw6areKH4gQT1q6uw45FqMC4eIIQQKUMW1SAaXYEm5hQgN K9vjmODY2+3mSDpZAmCzllgiScI+E+Nxjvar9cUy5ED8WLxPcgWCnFyD58FdtsgN6Go6 ZwwA== 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=b8IhmGYqSYpZeyKL34BPrei0uKRAlWmNhh1KLLr+KzY=; b=Ak5HWYY7rmd7dVj7ReGUoj9eH1P2xT+L1KxCEN83mWxRk23NO/kplMv14f0+2+LjMw XoHe2Fm8qexiRxlljT8DNCjSJjzJ805lYMWvzhzjDyM4+VvcQy/q7csnnh3l4pwFptFG ZBnu7sZqVAM3aK5cBc61DDLSEHlgt4zFhoJAwsVTOoDrxMXgqrPDogRjAoS9SiompLZS yr6rFA9bRM0v3G+eL9Grm3/cXKUTg75Zaft0bL5rlP41a0Mi62qzxbGDdwnxg/PJ8RSg gFqLZSHUjzzJ/2+zbuxO51iOpv7dWHU+/aKzZwJPU6dq5fq0uzRJmrnphLG9o5sYfP4v RcEA== 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 k4si792365pff.186.2017.11.07.01.40.38; Tue, 07 Nov 2017 01:40:39 -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 S1756729AbdKGJkg (ORCPT + 26 others); Tue, 7 Nov 2017 04:40:36 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:46360 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752717AbdKGJkc (ORCPT ); Tue, 7 Nov 2017 04:40:32 -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 9F5DA1435; Tue, 7 Nov 2017 01:40:31 -0800 (PST) Received: from sugar.kfn.arm.com (unknown [10.45.48.162]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ED1EF3F220; Tue, 7 Nov 2017 01:40:29 -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 3/8] staging: ccree: simplify AEAD using local var Date: Tue, 7 Nov 2017 09:39:59 +0000 Message-Id: <1510047606-5589-4-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510047606-5589-1-git-send-email-gilad@benyossef.com> References: <1510047606-5589-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 Make the code more readable by using a local variable for commonly use expression in the AEAD part of the driver. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c index 0b5b230..f1a3976 100644 --- a/drivers/staging/ccree/ssi_aead.c +++ b/drivers/staging/ccree/ssi_aead.c @@ -251,13 +251,11 @@ static void ssi_aead_complete(struct device *dev, void *ssi_req, void __iomem *c } } else { /*ENCRYPT*/ if (unlikely(areq_ctx->is_icv_fragmented)) { + u32 loc = areq->cryptlen + areq_ctx->dst_offset; + cc_copy_sg_portion(dev, areq_ctx->mac_buf, - areq_ctx->dst_sgl, - (areq->cryptlen + - areq_ctx->dst_offset), - (areq->cryptlen + - areq_ctx->dst_offset + - ctx->authsize), + areq_ctx->dst_sgl, loc, + (loc + ctx->authsize), SSI_SG_FROM_BUF); }