From patchwork Thu Nov 9 09:16:11 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: 118418 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp6346683qgn; Thu, 9 Nov 2017 01:17:50 -0800 (PST) X-Google-Smtp-Source: ABhQp+R77PqgiZ7ViEnsfvDnsV7jANvJHKttKz+VclEDCmEhLZmmAX/A5siJ6AgyRHOoc7Ij0o7b X-Received: by 10.99.63.3 with SMTP id m3mr599964pga.384.1510219070231; Thu, 09 Nov 2017 01:17:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510219070; cv=none; d=google.com; s=arc-20160816; b=JAVrXI0pV5q38bao6wXsx+CHoo9+SXRUCjqXkOdkqNeGEyn3Yy9wjN2jY8alBfFJWA IIpJcPBXjJyIqFnI7KjGEmtwxUL7Jgve/uJ6EQ4oIjNY90qUM+Djh0tInx5xts73ZFcS BDui0ZWGpfBAsKg8BpoxG114VqrNtEHudqkk/QfLMugnyoQh/akfq4W4qruprLquwRb5 YdPuGzwJgiwxbxJD3Xu5JHBTtx7e8W529ctR/kH48btb5MyMnJ3XUCOhK/aChGYJygtT UHAapDBi3yZEN4MWFtIJrnuwY+3J42cjRPxQ250PFx8U5OACNWW/NOObo85BB+Y5z34X nzoA== 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=LRizy4W3EfBZZnQPp5CO8iV5kEFlWBSFvWVNVyfOcpo=; b=QOpyZ60AZ8ok9Qh7mB4Konu2buUo8XI1vWozNfC3TTqPitcy9EIveKZ7BRYtbsDa9Y ms/okYSNLYYke3nXXtDYqaFFtDkjh7H/TAbCGnik3AvuGLPdpEbltQib3F6PZJz6q3kS fEoWrnwl2eD8O75j6U5sBgVs343bTE5fO4DfLiWtBlOEnDppsIu/ZfhdveyUM5Su4DbU j4vKar9AhOKnaigJt3wxxVNehRgos+Db0ACcwuhj+wOYW/ejXCBA4MzMknZnUHQXqFos TozHeViX9fGmzCWOTD/79OdDw53eW6MlBD2oIf2hfkagJRaJ5NovOAj75VcPvJkFKGT/ EoQA== 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 n9si5872415pgc.688.2017.11.09.01.17.49; Thu, 09 Nov 2017 01:17:50 -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 S1754104AbdKIJRq (ORCPT + 25 others); Thu, 9 Nov 2017 04:17:46 -0500 Received: from foss.arm.com ([217.140.101.70]:43604 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753925AbdKIJLK (ORCPT ); Thu, 9 Nov 2017 04:11:10 -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 AF9A11435; Thu, 9 Nov 2017 01:11:10 -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 541973F246; Thu, 9 Nov 2017 01:11:08 -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 v2 03/10] staging: ccree: simplify AEAD using local var Date: Thu, 9 Nov 2017 09:16:11 +0000 Message-Id: <1510218980-3549-4-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510218980-3549-1-git-send-email-gilad@benyossef.com> References: <1510218980-3549-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..a8e1371 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 skip = 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, skip, + (skip + ctx->authsize), SSI_SG_FROM_BUF); }