diff mbox

add static where possible

Message ID 1393125781-44443-1-git-send-email-mike.holmes@linaro.org
State Accepted, archived
Commit 5996703ec8cc2b8bf777cf12809321ca76502717
Headers show

Commit Message

Mike Holmes Feb. 23, 2014, 3:23 a.m. UTC
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(-)
diff mbox

Patch

diff --git a/platform/linux-generic/source/odp_ring.c b/platform/linux-generic/source/odp_ring.c
index 2326846..25ff66a 100644
--- a/platform/linux-generic/source/odp_ring.c
+++ b/platform/linux-generic/source/odp_ring.c
@@ -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)
diff --git a/test/api_test/odp_atomic_test.c b/test/api_test/odp_atomic_test.c
index 561cb34..ea443a0 100644
--- a/test/api_test/odp_atomic_test.c
+++ b/test/api_test/odp_atomic_test.c
@@ -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,
diff --git a/test/api_test/odp_atomic_test.h b/test/api_test/odp_atomic_test.h
index c6795a5..04dde72 100644
--- a/test/api_test/odp_atomic_test.h
+++ b/test/api_test/odp_atomic_test.h
@@ -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);
diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c
index 5ead65e..5c7a487 100644
--- a/test/api_test/odp_common.c
+++ b/test/api_test/odp_common.c
@@ -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)