From: Andy Green Date: Sat, 12 May 2018 01:59:17 +0000 (+0800) Subject: spinlock/x86: move stack declaration before code X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f7f18e92a51276f1e23a0595f59615f79323b358;p=dpdk.git spinlock/x86: move stack declaration before code In function 'rte_try_tm': rte_spinlock.h:82:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] int retries = RTE_RTM_MAX_RETRIES; Fixes: ba7468997ea6 ("spinlock: add HTM lock elision for x86") Cc: stable@dpdk.org Signed-off-by: Andy Green Reviewed-by: Stephen Hemminger --- 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 4b16887ead..60321da024 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--)) {