mirror of
https://github.com/openvswitch/ovs
synced 2025-10-25 15:07:05 +00:00
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>
This commit is contained in:
@@ -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)
|
int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *mutex)
|
||||||
OVS_MUST_HOLD(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) \
|
#define pthread_mutex_trylock(MUTEX) \
|
||||||
({ \
|
({ \
|
||||||
int retval = pthread_mutex_trylock(mutex); \
|
int retval = pthread_mutex_trylock(mutex); \
|
||||||
|
|||||||
Reference in New Issue
Block a user