From 6df138b3dc67aeff1263ad5ba9da43b13c0f30a8 Mon Sep 17 00:00:00 2001 From: Konstantin Khlebnikov Date: Thu, 3 May 2012 15:43:51 +1000 Subject: [PATCH] bug: completely remove code generated by disabled VM_BUG_ON() Even if CONFIG_DEBUG_VM=n gcc genereates code for some VM_BUG_ON() for example VM_BUG_ON(!PageCompound(page) || !PageHead(page)); in do_huge_pmd_wp_page() generates 114 bytes of code. But they mostly disappears when I split this VM_BUG_ON into two: -VM_BUG_ON(!PageCompound(page) || !PageHead(page)); +VM_BUG_ON(!PageCompound(page)); +VM_BUG_ON(!PageHead(page)); weird... but anyway after this patch code disappears completely. add/remove: 0/0 grow/shrink: 7/97 up/down: 135/-1784 (-1649) Signed-off-by: Konstantin Khlebnikov Cc: Linus Torvalds Cc: Geert Uytterhoeven Cc: "H. Peter Anvin" Cc: Cong Wang Cc: Hugh Dickins Signed-off-by: Andrew Morton --- include/linux/mmdebug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h index c04ecfe03f7f..580bd587d916 100644 --- a/include/linux/mmdebug.h +++ b/include/linux/mmdebug.h @@ -4,7 +4,7 @@ #ifdef CONFIG_DEBUG_VM #define VM_BUG_ON(cond) BUG_ON(cond) #else -#define VM_BUG_ON(cond) do { (void)(cond); } while (0) +#define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond) #endif #ifdef CONFIG_DEBUG_VIRTUAL -- 2.39.5