summaryrefslogtreecommitdiff
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>2011-05-25 04:13:16 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 19:39:46 +0400
commit903c0c7cdc21f2ccb7562a7bbc70289c0c2b16ad (patch)
tree66920b370d8fb301f4a203c66f9d397943f6dddd /include/linux/kernel.h
parentd2b463135f84d15808163cd15638b108e323d3e7 (diff)
downloadlinux-903c0c7cdc21f2ccb7562a7bbc70289c0c2b16ad.tar.xz
sparse: define dummy BUILD_BUG_ON definition for sparse
BUILD_BUG_ON() causes a syntax error to detect coding errors. So it causes sparse to detect an error too. This reduces sparse's usefulness. This patch makes a dummy BUILD_BUG_ON() definition for sparse. Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Dave Hansen <dave@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f37ba716ef8b..22295244de18 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -638,6 +638,13 @@ struct sysinfo {
char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
};
+#ifdef __CHECKER__
+#define BUILD_BUG_ON_NOT_POWER_OF_2(n)
+#define BUILD_BUG_ON_ZERO(e)
+#define BUILD_BUG_ON_NULL(e)
+#define BUILD_BUG_ON(condition)
+#else /* __CHECKER__ */
+
/* Force a compilation error if a constant expression is not a power of 2 */
#define BUILD_BUG_ON_NOT_POWER_OF_2(n) \
BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
@@ -674,6 +681,7 @@ extern int __build_bug_on_failed;
if (condition) __build_bug_on_failed = 1; \
} while(0)
#endif
+#endif /* __CHECKER__ */
/* Trap pasters of __FUNCTION__ at compile-time */
#define __FUNCTION__ (__func__)