From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 836011B2B4 for ; Wed, 8 Nov 2017 11:28:20 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP; 08 Nov 2017 02:28:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,363,1505804400"; d="scan'208";a="2352592" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.32]) by orsmga001.jf.intel.com with SMTP; 08 Nov 2017 02:28:16 -0800 Received: by (sSMTP sendmail emulation); Wed, 08 Nov 2017 10:28:15 +0000 Date: Wed, 8 Nov 2017 10:28:14 +0000 From: Bruce Richardson To: Jia He Cc: jerin.jacob@caviumnetworks.com, dev@dpdk.org, olivier.matz@6wind.com, konstantin.ananyev@intel.com, jianbo.liu@arm.com, hemant.agrawal@nxp.com, jia.he@hxt-semitech.com Message-ID: <20171108102814.GA7552@bricha3-MOBL3.ger.corp.intel.com> References: <1510121832-16439-1-git-send-email-hejianet@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1510121832-16439-1-git-send-email-hejianet@gmail.com> Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.9.1 (2017-09-22) Subject: Re: [dpdk-dev] [PATCH 1/3] eal/arm64: remove the braces {} for dmb(), dsb() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 10:28:20 -0000 On Wed, Nov 08, 2017 at 06:17:10AM +0000, Jia He wrote: > for the code as follows: > if (condition) > rte_smp_rmb(); > else > rte_smp_wmb(); > Without this patch, compiler will report this error: > error: 'else' without a previous 'if' > > Signed-off-by: Jia He > Signed-off-by: jia.he@hxt-semitech.com > --- > lib/librte_eal/common/include/arch/arm/rte_atomic_64.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h b/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h > index 0b70d62..38c3393 100644 > --- a/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h > +++ b/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h > @@ -43,8 +43,8 @@ extern "C" { > > #include "generic/rte_atomic.h" > > -#define dsb(opt) { asm volatile("dsb " #opt : : : "memory"); } > -#define dmb(opt) { asm volatile("dmb " #opt : : : "memory"); } > +#define dsb(opt) asm volatile("dsb " #opt : : : "memory"); > +#define dmb(opt) asm volatile("dmb " #opt : : : "memory"); > Need to remove the trailing ";" I too I think. Alternatively, to keep the braces, the standard practice is to use do { ... } while(0) Regards, /Bruce