kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm tools: Use assert() helper to check a variable value
@ 2011-12-18 21:35 Cyrill Gorcunov
  2011-12-19  7:13 ` Pekka Enberg
  0 siblings, 1 reply; 12+ messages in thread
From: Cyrill Gorcunov @ 2011-12-18 21:35 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: Sasha Levin, Asias He, Ingo Molnar, Thomas Gleixner, KVM-ML

BUILD_BUG_ON is unable to catch errors on expression which
can't be evaluated at compile time.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 tools/kvm/x86/bios.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6.git/tools/kvm/x86/bios.c
===================================================================
--- linux-2.6.git.orig/tools/kvm/x86/bios.c
+++ linux-2.6.git/tools/kvm/x86/bios.c
@@ -5,6 +5,7 @@
 #include "kvm/util.h"
 
 #include <string.h>
+#include <assert.h>
 #include <asm/e820.h>
 
 #include "bios/bios-rom.h"
@@ -98,7 +99,7 @@ static void e820_setup(struct kvm *kvm)
 		};
 	}
 
-	BUILD_BUG_ON(i > E820_X_MAX);
+	assert(i <= E820_X_MAX);
 
 	e820->nr_map = i;
 }

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-12-19 10:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-18 21:35 [PATCH] kvm tools: Use assert() helper to check a variable value Cyrill Gorcunov
2011-12-19  7:13 ` Pekka Enberg
2011-12-19  7:57   ` Cyrill Gorcunov
2011-12-19  8:04     ` Ingo Molnar
2011-12-19  8:19     ` Pekka Enberg
2011-12-19  8:25       ` Cyrill Gorcunov
2011-12-19  8:48         ` Pekka Enberg
2011-12-19 10:40         ` Ingo Molnar
2011-12-19 10:49           ` Cyrill Gorcunov
2011-12-19 10:50             ` Ingo Molnar
2011-12-19 10:57               ` Pekka Enberg
2011-12-19 10:57               ` Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).