Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] bug: Fix sparse warning related to BUILD_BUG_ON_INVALID

13 views
Skip to first unread message

Tushar Behera

unread,
Nov 19, 2012, 6:30:02 AM11/19/12
to
commit baf05aa9271b ("bug: introduce BUILD_BUG_ON_INVALID() macro")
introduces this macro when only _CHECKER_ is defined. Define
a silent macro in the else condition to fix following sparse
warning.

mm/filemap.c:395:9: error: undefined identifier 'BUILD_BUG_ON_INVALID'
mm/filemap.c:396:9: error: undefined identifier 'BUILD_BUG_ON_INVALID'
mm/filemap.c:397:9: error: undefined identifier 'BUILD_BUG_ON_INVALID'
include/linux/mm.h:419:9: error: undefined identifier 'BUILD_BUG_ON_INVALID'
include/linux/mm.h:419:9: error: not a function <noident>

Signed-off-by: Tushar Behera <tushar...@linaro.org>
---
include/linux/bug.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/bug.h b/include/linux/bug.h
index aaac4bb..b1cf40d 100644
--- a/include/linux/bug.h
+++ b/include/linux/bug.h
@@ -15,6 +15,7 @@ struct pt_regs;
#define BUILD_BUG_ON_NOT_POWER_OF_2(n)
#define BUILD_BUG_ON_ZERO(e) (0)
#define BUILD_BUG_ON_NULL(e) ((void*)0)
+#define BUILD_BUG_ON_INVALID(e) (0)
#define BUILD_BUG_ON(condition)
#define BUILD_BUG() (0)
#else /* __CHECKER__ */
--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Konstantin Khlebnikov

unread,
Nov 19, 2012, 6:50:01 AM11/19/12
to
Tushar Behera wrote:
> commit baf05aa9271b ("bug: introduce BUILD_BUG_ON_INVALID() macro")
> introduces this macro when only _CHECKER_ is defined. Define
> a silent macro in the else condition to fix following sparse
> warning.
>
> mm/filemap.c:395:9: error: undefined identifier 'BUILD_BUG_ON_INVALID'
> mm/filemap.c:396:9: error: undefined identifier 'BUILD_BUG_ON_INVALID'
> mm/filemap.c:397:9: error: undefined identifier 'BUILD_BUG_ON_INVALID'
> include/linux/mm.h:419:9: error: undefined identifier 'BUILD_BUG_ON_INVALID'
> include/linux/mm.h:419:9: error: not a function<noident>
>
> Signed-off-by: Tushar Behera<tushar...@linaro.org>

Thanks.

Signed-off-by: Konstantin Khlebnikov <khleb...@openvz.org>

> ---
> include/linux/bug.h | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/bug.h b/include/linux/bug.h
> index aaac4bb..b1cf40d 100644
> --- a/include/linux/bug.h
> +++ b/include/linux/bug.h
> @@ -15,6 +15,7 @@ struct pt_regs;
> #define BUILD_BUG_ON_NOT_POWER_OF_2(n)
> #define BUILD_BUG_ON_ZERO(e) (0)
> #define BUILD_BUG_ON_NULL(e) ((void*)0)
> +#define BUILD_BUG_ON_INVALID(e) (0)
> #define BUILD_BUG_ON(condition)
> #define BUILD_BUG() (0)
> #else /* __CHECKER__ */

--
0 new messages