From fb42720ed20a4268d44df3f39e3ec5fd00261e28 Mon Sep 17 00:00:00 2001 From: Daniele Di Proietto Date: Thu, 7 Aug 2014 01:35:11 +0000 Subject: test-atomic: Fix warnings for GCC4.9 and sparse There's no reason for the local variable 'old_count' to be atomic. In fact, if it is atomic it triggers a GCC4.9 warning (Wunused-value) The global variables 'a' and 'paux' could be static, according to sparse. Signed-off-by: Daniele Di Proietto Acked-by: Jarno Rajahalme --- tests/test-atomic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/test-atomic.c') diff --git a/tests/test-atomic.c b/tests/test-atomic.c index ca293bacc..31c06fa81 100644 --- a/tests/test-atomic.c +++ b/tests/test-atomic.c @@ -167,7 +167,7 @@ test_atomic_flag(void) ovs_assert(atomic_flag_test_and_set(&flag) == false); } -uint32_t a; +static uint32_t a; struct atomic_aux { atomic_uint32_t count; @@ -175,7 +175,7 @@ struct atomic_aux { ATOMIC(uint32_t *) data; }; -ATOMIC(struct atomic_aux *) paux = ATOMIC_VAR_INIT(NULL); +static ATOMIC(struct atomic_aux *) paux = ATOMIC_VAR_INIT(NULL); static struct atomic_aux *auxes = NULL; #define ATOMIC_ITEM_COUNT 1000000 @@ -273,7 +273,7 @@ static void * atomic_writer(void *aux_) { struct atomic_aux *aux = aux_; - atomic_uint32_t old_count; + uint32_t old_count; uint32_t *data; size_t i; -- cgit v1.2.1