From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: Re: [PATCH 5/8] staging: ccree: fold common code into function Date: Tue, 7 Nov 2017 13:40:31 +0300 Message-ID: <20171107104031.kffrjerag2viukyo@mwanda> References: <1510047606-5589-1-git-send-email-gilad@benyossef.com> <1510047606-5589-6-git-send-email-gilad@benyossef.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman , driverdev-devel@linuxdriverproject.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Ofir Drang To: Gilad Ben-Yossef Return-path: Content-Disposition: inline In-Reply-To: <1510047606-5589-6-git-send-email-gilad@benyossef.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" List-Id: linux-crypto.vger.kernel.org On Tue, Nov 07, 2017 at 09:40:01AM +0000, Gilad Ben-Yossef wrote: > @@ -669,21 +690,12 @@ void cc_unmap_aead_request(struct device *dev, struct aead_request *req) > } > if (drvdata->coherent && > (areq_ctx->gen_ctx.op_type == DRV_CRYPTO_DIRECTION_DECRYPT) && > - likely(req->src == req->dst)) { > - u32 size_to_skip = req->assoclen; > - > - if (areq_ctx->is_gcm4543) > - size_to_skip += crypto_aead_ivsize(tfm); > + likely(req->src == req->dst)) Don't remove the curly braces from this one. Multi-line indents get curly braces for readability. > > - /* copy mac to a temporary location to deal with possible > + /* copy back mac from temporary location to deal with possible > * data memory overriding that caused by cache coherence problem. > */ > - cc_copy_sg_portion(dev, areq_ctx->backup_mac, req->src, > - (size_to_skip + req->cryptlen - > - areq_ctx->req_authsize), > - (size_to_skip + req->cryptlen), > - SSI_SG_FROM_BUF); > - } > + cc_copy_mac(dev, req, SSI_SG_FROM_BUF); > } regards, dan carpenter From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757169AbdKGKk4 (ORCPT ); Tue, 7 Nov 2017 05:40:56 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:23951 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753459AbdKGKky (ORCPT ); Tue, 7 Nov 2017 05:40:54 -0500 Date: Tue, 7 Nov 2017 13:40:31 +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 5/8] staging: ccree: fold common code into function Message-ID: <20171107104031.kffrjerag2viukyo@mwanda> References: <1510047606-5589-1-git-send-email-gilad@benyossef.com> <1510047606-5589-6-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-6-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:40:01AM +0000, Gilad Ben-Yossef wrote: > @@ -669,21 +690,12 @@ void cc_unmap_aead_request(struct device *dev, struct aead_request *req) > } > if (drvdata->coherent && > (areq_ctx->gen_ctx.op_type == DRV_CRYPTO_DIRECTION_DECRYPT) && > - likely(req->src == req->dst)) { > - u32 size_to_skip = req->assoclen; > - > - if (areq_ctx->is_gcm4543) > - size_to_skip += crypto_aead_ivsize(tfm); > + likely(req->src == req->dst)) Don't remove the curly braces from this one. Multi-line indents get curly braces for readability. > > - /* copy mac to a temporary location to deal with possible > + /* copy back mac from temporary location to deal with possible > * data memory overriding that caused by cache coherence problem. > */ > - cc_copy_sg_portion(dev, areq_ctx->backup_mac, req->src, > - (size_to_skip + req->cryptlen - > - areq_ctx->req_authsize), > - (size_to_skip + req->cryptlen), > - SSI_SG_FROM_BUF); > - } > + cc_copy_mac(dev, req, SSI_SG_FROM_BUF); > } regards, dan carpenter From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 7 Nov 2017 13:40:31 +0300 From: Dan Carpenter Subject: Re: [PATCH 5/8] staging: ccree: fold common code into function Message-ID: <20171107104031.kffrjerag2viukyo@mwanda> References: <1510047606-5589-1-git-send-email-gilad@benyossef.com> <1510047606-5589-6-git-send-email-gilad@benyossef.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1510047606-5589-6-git-send-email-gilad@benyossef.com> List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Gilad Ben-Yossef Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman , driverdev-devel@linuxdriverproject.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Ofir Drang On Tue, Nov 07, 2017 at 09:40:01AM +0000, Gilad Ben-Yossef wrote: > @@ -669,21 +690,12 @@ void cc_unmap_aead_request(struct device *dev, struct aead_request *req) > } > if (drvdata->coherent && > (areq_ctx->gen_ctx.op_type == DRV_CRYPTO_DIRECTION_DECRYPT) && > - likely(req->src == req->dst)) { > - u32 size_to_skip = req->assoclen; > - > - if (areq_ctx->is_gcm4543) > - size_to_skip += crypto_aead_ivsize(tfm); > + likely(req->src == req->dst)) Don't remove the curly braces from this one. Multi-line indents get curly braces for readability. > > - /* copy mac to a temporary location to deal with possible > + /* copy back mac from temporary location to deal with possible > * data memory overriding that caused by cache coherence problem. > */ > - cc_copy_sg_portion(dev, areq_ctx->backup_mac, req->src, > - (size_to_skip + req->cryptlen - > - areq_ctx->req_authsize), > - (size_to_skip + req->cryptlen), > - SSI_SG_FROM_BUF); > - } > + cc_copy_mac(dev, req, SSI_SG_FROM_BUF); > } regards, dan carpenter _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel