Whamcloud - gitweb
LU-2675 cleanup: define sparse annotations for libcfs 69/6969/2
authorJohn L. Hammond <john.hammond@intel.com>
Fri, 12 Jul 2013 20:31:28 +0000 (15:31 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 3 Sep 2013 05:37:54 +0000 (05:37 +0000)
Add empty definitions for the sparse checker annotations (__user,
__kernel, __safe, ...) defined by the kernel. This will allow these
annotations to be used in files common to kernel modules and libcfs.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I26a7d3fad0bc07535db4dfaa25e40bb10ff4e951
Reviewed-on: http://review.whamcloud.com/6969
Tested-by: Hudson
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Sebastien Buisson <sebastien.buisson@bull.net>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
libcfs/include/libcfs/posix/posix-types.h

index 74e1383..d4a378d 100644 (file)
@@ -99,4 +99,20 @@ typedef unsigned long long __u64;
 typedef unsigned long ulong_ptr_t;
 typedef long long_ptr_t;
 
+/* Sparse annotations, copied from linux/compiler.h. */
+#define __user
+#define __kernel
+#define __safe
+#define __force
+#define __nocast
+#define __iomem
+#define __chk_user_ptr(x) ((void)0)
+#define __chk_io_ptr(x) ((void)0)
+#define __builtin_warning(x, y...) (1)
+#define __acquires(x)
+#define __releases(x)
+#define __acquire(x) ((void)0)
+#define __release(x) ((void)0)
+#define __cond_lock(x, c) (c)
+
 #endif