aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2013-08-12 15:49:25 -0700
committerBen Pfaff <blp@nicira.com>2013-08-13 09:42:28 -0700
commit47b52c71232c01837e5c5e374af8033fbf711f0f (patch)
tree70671555baf4350f7423853d2b9ad76c544479c0 /lib/compiler.h
parentbf19526b900f80b17980fca578d278a18522c8b4 (diff)
sparse: Remove support for thread-safety annotations.
The Clang support for thread-safety annotations is much more effective than "sparse" support. I found that I was unable to make the annotations warning-free under sparse. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'lib/compiler.h')
-rw-r--r--lib/compiler.h29
1 files changed, 1 insertions, 28 deletions
diff --git a/lib/compiler.h b/lib/compiler.h
index 2ca81bdb..519b8329 100644
--- a/lib/compiler.h
+++ b/lib/compiler.h
@@ -128,32 +128,7 @@
#define OVS_EXCLUDED(...) __attribute__((locks_excluded(__VA_ARGS__)))
#define OVS_ACQ_BEFORE(...) __attribute__((acquired_before(__VA_ARGS__)))
#define OVS_ACQ_AFTER(...) __attribute__((acquired_after(__VA_ARGS__)))
-#elif __CHECKER__
-/* "sparse" annotations for mutexes and mutex-like constructs.
- *
- * Change the thread-safety check annotations to use "context" attribute.
- *
- * OVS_MACRO_LOCK and OVS_MACRO_RELEASE are suitable for use within macros,
- * where there is no function prototype to annotate. */
-#define OVS_LOCKABLE
-#define OVS_REQ_RDLOCK(...) __attribute__((context(MUTEX, 1, 1)))
-#define OVS_ACQ_RDLOCK(...) __attribute__((context(MUTEX, 0, 1)))
-#define OVS_REQ_WRLOCK(...) __attribute__((context(MUTEX, 1, 1)))
-#define OVS_ACQ_WRLOCK(...) __attribute__((context(MUTEX, 0, 1)))
-#define OVS_REQUIRES(...) __attribute__((context(MUTEX, 1, 1)))
-#define OVS_ACQUIRES(...) __attribute__((context(MUTEX, 0, 1)))
-#define OVS_TRY_WRLOCK(RETVAL, ...)
-#define OVS_TRY_RDLOCK(RETVAL, ...)
-#define OVS_TRY_LOCK(REVAL, ...)
-#define OVS_GUARDED
-#define OVS_GUARDED_BY(...)
-#define OVS_EXCLUDED(...)
-#define OVS_RELEASES(...) __attribute__((context(MUTEX, 1, 0)))
-#define OVS_ACQ_BEFORE(...)
-#define OVS_ACQ_AFTER(...)
-#define OVS_MACRO_LOCK(...) __context__(MUTEX, 0, 1)
-#define OVS_MACRO_RELEASE(...) __context__(MUTEX, 1, 0)
-#else
+#else /* not Clang */
#define OVS_LOCKABLE
#define OVS_REQ_RDLOCK(...)
#define OVS_ACQ_RDLOCK(...)
@@ -170,8 +145,6 @@
#define OVS_RELEASES(...)
#define OVS_ACQ_BEFORE(...)
#define OVS_ACQ_AFTER(...)
-#define OVS_MACRO_LOCK(...)
-#define OVS_MACRO_RELEASE(...)
#endif
/* ISO C says that a C implementation may choose any integer type for an enum