From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756851AbdKGKfo (ORCPT ); Tue, 7 Nov 2017 05:35:44 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:21837 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752322AbdKGKfi (ORCPT ); Tue, 7 Nov 2017 05:35:38 -0500 Date: Tue, 7 Nov 2017 13:35:23 +0300 From: Dan Carpenter To: Gilad Ben-Yossef Cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, driverdev-devel@linuxdriverproject.org, linux-crypto@vger.kernel.org, Ofir Drang Subject: Re: [PATCH 3/8] staging: ccree: simplify AEAD using local var Message-ID: <20171107103523.ests5w6m3c7ria73@mwanda> References: <1510047606-5589-1-git-send-email-gilad@benyossef.com> <1510047606-5589-4-git-send-email-gilad@benyossef.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1510047606-5589-4-git-send-email-gilad@benyossef.com> User-Agent: NeoMutt/20170609 (1.8.3) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 07, 2017 at 09:39:59AM +0000, Gilad Ben-Yossef wrote: > 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(-) > > 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; "loc" isn't a very canonical name. At first I thought this was "pos" or maybe "end" but now I'm thinking this is "skip"? I don't know what this variable is. > + > 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); > } regards, dan carpenter