From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 67AFDA0564; Fri, 12 Mar 2021 02:34:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C6B14067E; Fri, 12 Mar 2021 02:34:17 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 3BDC74014D for ; Fri, 12 Mar 2021 02:34:15 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 85C4720B39C5; Thu, 11 Mar 2021 17:34:14 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 85C4720B39C5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1615512854; bh=qKp/G14cqjJDIkmQOGSLtvRRPY/8u155jP3xARGcro0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mtAM0KlwuoQQJl/JUnY7kh9gnW4ijCmooqiiM/pn4VxG5ESB4+LOT7HDAJFB5Vj/l TZsOgVrYuihAlfsMd9wITQkjTLBCKDYdCfzDlur94NNx/Q8FuEw3nj/nrnsqX16cXD YJoNFYvF9OmhuUyWqoRbVmYmUxkLceFocrnU+mOc= Date: Thu, 11 Mar 2021 17:34:14 -0800 From: Tyler Retzlaff To: Ranjit Menon Cc: dev@dpdk.org, thomas@monjalon.net Message-ID: <20210312013414.GA6784@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1615496911-7050-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] [PATCH] eal: avoid side effects in RTE_ALIGN_MUL_NEAR(v, mul) for v and mul X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Mar 11, 2021 at 04:40:58PM -0800, Ranjit Menon wrote: > > On 3/11/2021 1:08 PM, Tyler Retzlaff wrote: > >diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h > >index 1b630baf1..640befee2 100644 > >--- a/lib/librte_eal/include/rte_common.h > >+++ b/lib/librte_eal/include/rte_common.h > >@@ -345,9 +345,11 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) > > */ > > #define RTE_ALIGN_MUL_NEAR(v, mul) \ > > ({ \ > >- typeof(v) ceil = RTE_ALIGN_MUL_CEIL(v, mul); \ > >- typeof(v) floor = RTE_ALIGN_MUL_FLOOR(v, mul); \ > >- (ceil - (v)) > ((v) - floor) ? floor : ceil; \ > >+ typeof(v) _v = (v); \ > >+ typeof(v) _m = (mul); \ > For consistency sake, can this variable be changed to '_mul'? sure, i can do that. it will hit another tab stop below though. i'll submit a v2 with the requested change. > >+ typeof(v) ceil = RTE_ALIGN_MUL_CEIL(_v, _m); \ > >+ typeof(v) floor = RTE_ALIGN_MUL_FLOOR(_v, _m); \ > >+ (ceil - (_v)) > ((_v) - floor) ? floor : ceil; \ > > }) > > /** > > > ranjit m.