spinlock/x86: move stack declaration before code
authorAndy Green <andy@warmcat.com>
Sat, 12 May 2018 01:59:17 +0000 (09:59 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 13 May 2018 20:45:21 +0000 (22:45 +0200)
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 <andy@warmcat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
lib/librte_eal/common/include/arch/x86/rte_spinlock.h

index 4b16887..60321da 100644 (file)
@@ -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--)) {