From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) by dpdk.org (Postfix) with ESMTP id 21A261CC95 for ; Sat, 12 May 2018 03:59:21 +0200 (CEST) From: Andy Green To: dev@dpdk.org Date: Sat, 12 May 2018 09:59:17 +0800 Message-ID: <152609035743.121661.16417462726686469432.stgit@localhost.localdomain> In-Reply-To: <152609021699.121661.5295227351721865436.stgit@localhost.localdomain> References: <152609021699.121661.5295227351721865436.stgit@localhost.localdomain> User-Agent: StGit/unknown-version Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] [PATCH v3 07/24] rte_spinlock.h: stack declarations before code 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: Sat, 12 May 2018 01:59:21 -0000 /projects/lagopus/src/dpdk/build/include/rte_spinlock.h: In function 'rte_try_tm': /projects/lagopus/src/dpdk/build/include/rte_spinlock.h:82:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] int retries = RTE_RTM_MAX_RETRIES; Signed-off-by: Andy Green --- .../common/include/arch/x86/rte_spinlock.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/include/arch/x86/rte_spinlock.h b/lib/librte_eal/common/include/arch/x86/rte_spinlock.h index 4b16887ea..60321da02 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_spinlock.h +++ b/lib/librte_eal/common/include/arch/x86/rte_spinlock.h @@ -76,10 +76,12 @@ static inline int rte_tm_supported(void) static inline int rte_try_tm(volatile int *lock) { + int retries; + if (!rte_rtm_supported) return 0; - int retries = RTE_RTM_MAX_RETRIES; + retries = RTE_RTM_MAX_RETRIES; while (likely(retries--)) {