From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH] ring: fix compilation error with a broken else clause Date: Tue, 30 Jan 2018 14:26:08 +0530 Message-ID: <20180130085607.GA29747@jerin> References: <0d242c92a3734252f6baa5592c56afeba254941b.1517301739.git.gowrishankar.m@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, Olivier Matz , thomas@monjalon.net To: Gowrishankar Return-path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0053.outbound.protection.outlook.com [104.47.38.53]) by dpdk.org (Postfix) with ESMTP id EFA571B2AA for ; Tue, 30 Jan 2018 09:56:54 +0100 (CET) Content-Disposition: inline In-Reply-To: <0d242c92a3734252f6baa5592c56afeba254941b.1517301739.git.gowrishankar.m@linux.vnet.ibm.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -----Original Message----- > Date: Tue, 30 Jan 2018 14:18:46 +0530 > From: Gowrishankar > To: dev@dpdk.org > CC: Olivier Matz , thomas@monjalon.net, > Gowrishankar Muthukrishnan > Subject: [dpdk-dev] [PATCH] ring: fix compilation error with a broken else > clause > X-Mailer: git-send-email 1.9.1 > > From: Gowrishankar Muthukrishnan > > Calling rte_smp_wmb macro expands into a compound block, which > would break compiling a else clause following it, if that calling > place has been terminated already with ";", as in below code. > This patch adds { } around this macro to allow compiling else too. > > Fixes: git show c9fb3c6289 ("ring: move code in a new header file") > > Signed-off-by: Gowrishankar Muthukrishnan > --- > > Error in compiling source: > > In file included from /tmp/dpdk/lib/librte_ring/rte_ring.h:372:0, > from /tmp/dpdk/lib/librte_ring/rte_ring.c:90: > /tmp/dpdk/lib/librte_ring/rte_ring_generic.h: In function ‘update_tail’: > /tmp/dpdk/lib/librte_ring/rte_ring_generic.h:75:2: error: ‘else’ without a previous ‘if’ > else > ^~~~ > /tmp/dpdk/mk/internal/rte.compile-pre.mk:114: recipe for target 'rte_ring.o' failed > > lib/librte_ring/rte_ring_generic.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_ring/rte_ring_generic.h b/lib/librte_ring/rte_ring_generic.h > index 8c3e65b..a668489 100644 > --- a/lib/librte_ring/rte_ring_generic.h > +++ b/lib/librte_ring/rte_ring_generic.h > @@ -70,8 +70,9 @@ > update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t new_val, > uint32_t single, uint32_t enqueue) > { > - if (enqueue) > + if (enqueue) { Just wondering, Is it because of rte_smp_wmb() implementation of ppc64 is not just correct? We had a similar fix for arm64. http://dpdk.org/browse/dpdk/commit/?id=59a3cae5305816b3739b4197d277f9455af53b9f > rte_smp_wmb(); > + } > else > rte_smp_rmb(); > /* > -- > 1.9.1 >