From mboxrd@z Thu Jan 1 00:00:00 1970 From: danielfsantos@att.net Subject: [PATCH v5 5/9] bug.h: Fix BUILD_BUG_ON macro in __CHECKER__ Date: Tue, 13 Nov 2012 16:13:37 -0600 Message-ID: <1352844821-18952-5-git-send-email-daniel.santos@pobox.com> References: <1352844568-18826-1-git-send-email-daniel.santos@pobox.com> Return-path: Received: from nm9-vm0.access.bullet.mail.mud.yahoo.com ([66.94.237.249]:26461 "EHLO nm9-vm0.access.bullet.mail.mud.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754780Ab2KMWN6 (ORCPT ); Tue, 13 Nov 2012 17:13:58 -0500 In-Reply-To: <1352844568-18826-1-git-send-email-daniel.santos@pobox.com> Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: LKML , Andi Kleen , Andrea Arcangeli , Andrew Morton , Borislav Petkov , Christopher Li , Daniel Santos , David Daney , David Howells , Joe Perches , Josh Triplett , Konstantin Khlebnikov , linux-sparse@vger.kernel.org, Michel Lespinasse , Paul Gortmaker , Pavel Pisa , Peter Zijlstra , Steven Rostedt When __CHECKER__ is defined, we disable all of the BUILD_BUG.* macros. However, both BUILD_BUG_ON_NOT_POWER_OF_2 and BUILD_BUG_ON was evaluating to nothing in this case, and we want (0) since this is a function-like macro that will be followed by a semicolon. Signed-off-by: Daniel Santos --- include/linux/bug.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/bug.h b/include/linux/bug.h index 298a916..1b2465d 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h @@ -12,10 +12,10 @@ enum bug_trap_type { struct pt_regs; #ifdef __CHECKER__ -#define BUILD_BUG_ON_NOT_POWER_OF_2(n) +#define BUILD_BUG_ON_NOT_POWER_OF_2(n) (0) #define BUILD_BUG_ON_ZERO(e) (0) #define BUILD_BUG_ON_NULL(e) ((void*)0) -#define BUILD_BUG_ON(condition) +#define BUILD_BUG_ON(condition) (0) #define BUILD_BUG() (0) #else /* __CHECKER__ */ -- 1.7.3.4