@@ -82,7 +82,7 @@
#include <odp_rwlock.h>
#include <helper/odp_ring.h>
-TAILQ_HEAD(, odp_ring) odp_ring_list;
+static TAILQ_HEAD(, odp_ring) odp_ring_list;
/*
* the enqueue of pointers on the ring.
@@ -142,7 +142,7 @@ TAILQ_HEAD(, odp_ring) odp_ring_list;
} \
} while (0)
-odp_rwlock_t qlock; /* rings tailq lock */
+static odp_rwlock_t qlock; /* rings tailq lock */
/* init tailq_ring */
void odp_ring_tailq_init(void)
@@ -10,7 +10,13 @@
#include "odp_common.h"
#include "odp_atomic_test.h"
-const char * const test_name[] = {
+static odp_atomic_int_t a32;
+static odp_atomic_u32_t a32u;
+static odp_atomic_u64_t a64u;
+
+static odp_atomic_int_t numthrds;
+
+static const char * const test_name[] = {
"test atomic basic ops add/sub/inc/dec",
"test atomic inc/dec of signed word",
"test atomic add/sub of signed word",
@@ -20,7 +26,7 @@ const char * const test_name[] = {
"test atomic add/sub of unsigned double word"
};
-struct timeval tv0[MAX_WORKERS], tv1[MAX_WORKERS];
+static struct timeval tv0[MAX_WORKERS], tv1[MAX_WORKERS];
static void usage(void)
{
@@ -246,7 +252,7 @@ static void *run_thread(void *arg)
while (*(volatile int *)&numthrds < parg->numthrds)
;
- gettimeofday(&tv0[thr], 0);
+ gettimeofday(&tv0[thr], NULL);
switch (parg->testcase) {
case TEST_MIX:
@@ -271,7 +277,7 @@ static void *run_thread(void *arg)
test_atomic_add_sub_64();
break;
}
- gettimeofday(&tv1[thr], 0);
+ gettimeofday(&tv1[thr], NULL);
fflush(NULL);
printf("Time taken in thread %02d to complete op is %lld usec\n", thr,
@@ -30,11 +30,7 @@
#define TEST_INC_DEC_64 6
#define TEST_ADD_SUB_64 7
#define TEST_MAX 7 /* This must match the last test case num */
-odp_atomic_int_t a32;
-odp_atomic_u32_t a32u;
-odp_atomic_u64_t a64u;
-odp_atomic_int_t numthrds;
void test_atomic_inc_dec_32(void);
void test_atomic_add_sub_32(void);
@@ -19,8 +19,8 @@
/* Globals */
-odp_linux_pthread_t thread_tbl[MAX_WORKERS];
-int num_workers;
+static odp_linux_pthread_t thread_tbl[MAX_WORKERS];
+static int num_workers;
__thread test_shared_data_t *test_shared_data;
void odp_print_system_info(void)
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> --- platform/linux-generic/source/odp_ring.c | 4 ++-- test/api_test/odp_atomic_test.c | 14 ++++++++++---- test/api_test/odp_atomic_test.h | 4 ---- test/api_test/odp_common.c | 4 ++-- 4 files changed, 14 insertions(+), 12 deletions(-)