From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: [PATCH] kvm tools: Use assert() helper to check a variable value Date: Mon, 19 Dec 2011 11:57:38 +0400 Message-ID: <20111219075738.GD17380@moon> References: <20111218213536.GB17380@moon> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Sasha Levin , Asias He , Ingo Molnar , Thomas Gleixner , KVM-ML To: Pekka Enberg Return-path: Received: from mail-ee0-f46.google.com ([74.125.83.46]:64873 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751781Ab1LSH5n (ORCPT ); Mon, 19 Dec 2011 02:57:43 -0500 Received: by eekc4 with SMTP id c4so5183227eek.19 for ; Sun, 18 Dec 2011 23:57:41 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Dec 19, 2011 at 09:13:28AM +0200, Pekka Enberg wrote: > > > >- BUILD_BUG_ON(i > E820_X_MAX); > >+ assert(i <= E820_X_MAX); > > We should use BUG_ON() like tools/perf does. > We dont have it yet. So I'll introduce this helper later, but note that we will have to cover _all_ assert() calls then, so it's better to make in a separate patch. Meanwhile such fix it better than bug ;) Cyrill