Skip to content

Commit ca39599

Browse files
Dr. David Alan Gilberttorvalds
authored andcommitted
BUILD_BUG_ON_ZERO: fix sparse breakage
BUILD_BUG_ON_ZERO and BUILD_BUG_ON_NULL must return values, even in the CHECKER case otherwise various users of it become syntactically invalid. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 3957c77 commit ca39599

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎include/linux/kernel.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,8 @@ struct sysinfo {
671671

672672
#ifdef __CHECKER__
673673
#define BUILD_BUG_ON_NOT_POWER_OF_2(n)
674-
#define BUILD_BUG_ON_ZERO(e)
675-
#define BUILD_BUG_ON_NULL(e)
674+
#define BUILD_BUG_ON_ZERO(e) (0)
675+
#define BUILD_BUG_ON_NULL(e) ((void*)0)
676676
#define BUILD_BUG_ON(condition)
677677
#else /* __CHECKER__ */
678678

0 commit comments

Comments
 (0)