diff options
author | Ethan Jackson <ethan@nicira.com> | 2013-07-09 15:27:12 -0700 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2013-07-10 17:24:27 -0700 |
commit | c5603ce8a18da14ba40508b23f0a27e2c4adf53a (patch) | |
tree | 2df5e909febbf0a689397e7190950ffe92d14ed9 /include/sparse | |
parent | a4fff9cc390b69bde1257b414212505a72c4b450 (diff) | |
download | openvswitch-c5603ce8a18da14ba40508b23f0a27e2c4adf53a.tar.gz |
atomic: Suppress sparse warning.
With the latest version of sparse, the ATOMIC_VAR_INIT macro
generates the following warning. This patch suppresses it.
warning: Using plain integer as NULL pointer
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'include/sparse')
-rw-r--r-- | include/sparse/pthread.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/sparse/pthread.h b/include/sparse/pthread.h index 7ba6a05ab..723c351ad 100644 --- a/include/sparse/pthread.h +++ b/include/sparse/pthread.h @@ -33,6 +33,12 @@ int pthread_rwlock_unlock(pthread_rwlock_t *rwlock) OVS_RELEASES(rwlock); int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *mutex) OVS_MUST_HOLD(mutex); +/* Sparse complains about the proper PTHREAD_MUTEX_INITIALIZER definition. + * Luckily, it's not a real compiler so we can overwrite it with something + * simple. */ +#undef PTHREAD_MUTEX_INITIALIZER +#define PTHREAD_MUTEX_INITIALIZER {} + #define pthread_mutex_trylock(MUTEX) \ ({ \ int retval = pthread_mutex_trylock(mutex); \ |