git » nmdb » commit db199aa

nmdb: Fix sparse annotations

author Alberto Bertogli
2010-04-11 07:35:35 UTC
committer Alberto Bertogli
2010-04-11 07:35:35 UTC
parent 7af1ac69fd6582d85a048acdcd95ede3386e2d3b

nmdb: Fix sparse annotations

New sparse releases disable the exact_context attribute because it was broken.
We just change the sparse annotation back to the regular context attribute,
which is also useful.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

nmdb/sparse.h +8 -5

diff --git a/nmdb/sparse.h b/nmdb/sparse.h
index 20adafc..c48b163 100644
--- a/nmdb/sparse.h
+++ b/nmdb/sparse.h
@@ -5,11 +5,14 @@
 #define _SPARSE_H
 
 #ifdef __CHECKER__
-# define __acquires(x) __attribute__((exact_context(x,0,1)))
-# define __releases(x) __attribute__((exact_context(x,1,0)))
-# define __with_lock_acquired(x) __attribute__((exact_context(x,1,1)))
-# define __acquire(x) __context__(x,1,0)
-# define __release(x) __context__(x,-1,1)
+# define __acquires(x) __attribute__((context(x,0,1)))
+# define __releases(x) __attribute__((context(x,1,0)))
+# define __acquire(x) __context__(x,1)
+# define __release(x) __context__(x,-1)
+/* __with_lock_acquired() is at the moment just documentation, but we keep it
+ * in case sparse gets the ability to match exact contexts again */
+//# define __with_lock_acquired(x) __attribute__((exact_context(x,1,1)))
+# define __with_lock_acquired(x)
 #else
 # define __acquires(x)
 # define __releases(x)