diff options
author | Daniele Di Proietto <ddiproietto@vmware.com> | 2014-08-07 01:35:11 +0000 |
---|---|---|
committer | Jarno Rajahalme <jrajahalme@nicira.com> | 2014-08-06 10:58:22 -0700 |
commit | fb42720ed20a4268d44df3f39e3ec5fd00261e28 (patch) | |
tree | 7088f5a59bc9628257f2eb402f9debfc921bb8a1 /tests/test-atomic.c | |
parent | 6c6814d678beda510e3e20edf6c47542517aa286 (diff) | |
download | openvswitch-fb42720ed20a4268d44df3f39e3ec5fd00261e28.tar.gz |
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 <ddiproietto@vmware.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Diffstat (limited to 'tests/test-atomic.c')
-rw-r--r-- | tests/test-atomic.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; |