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 <et...@nicira.com>
---
 lib/ovs-atomic-pthreads.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/ovs-atomic-pthreads.h b/lib/ovs-atomic-pthreads.h
index 2f47a9c..e6f3f1a 100644
--- a/lib/ovs-atomic-pthreads.h
+++ b/lib/ovs-atomic-pthreads.h
@@ -80,7 +80,11 @@ typedef enum {
     memory_order_seq_cst
 } memory_order;
 
+#if __CHECKER__
+#define ATOMIC_VAR_INIT(VALUE) { .value = VALUE }
+#else
 #define ATOMIC_VAR_INIT(VALUE) { VALUE, PTHREAD_MUTEX_INITIALIZER }
+#endif
 #define atomic_init(OBJECT, VALUE)                      \
     ((OBJECT)->value = (VALUE),                         \
      pthread_mutex_init(&(OBJECT)->mutex, NULL),        \
-- 
1.7.9.5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to