From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v8 3/8] xen/arm: return int *_dcache_va_range Date: Mon, 20 Oct 2014 16:27:39 +0100 Message-ID: <1413818859.29506.8.camel@citrix.com> References: <1413798499-28314-3-git-send-email-stefano.stabellini@eu.citrix.com> <1413817046.13796.21.camel@citrix.com> <5445452F02000078000405BD@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XgEsJ-0005JY-Uw for xen-devel@lists.xenproject.org; Mon, 20 Oct 2014 15:28:00 +0000 In-Reply-To: <5445452F02000078000405BD@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: julien.grall@citrix.com, xen-devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Mon, 2014-10-20 at 16:23 +0100, Jan Beulich wrote: > >>> On 20.10.14 at 16:57, wrote: > >> --- a/xen/arch/arm/mm.c > >> +++ b/xen/arch/arm/mm.c > >> @@ -388,7 +388,7 @@ void flush_page_to_ram(unsigned long mfn) > >> { > >> void *v = map_domain_page(mfn); > >> > >> - clean_and_invalidate_dcache_va_range(v, PAGE_SIZE); > >> + ASSERT(clean_and_invalidate_dcache_va_range(v, PAGE_SIZE) == 0); > > > > Just this one assert? What about all the other callers of > > *_dcache_va_range? > > I'm glad I looked at this reply (I skipped the original one because of > being ARM-only): Uses of ASSERT() like above won't work in non- > debug builds. You have to latch the result into a variable and assert > on it. The fundamental rule is: Expressions passed to ASSERT() must > never have side effects. That's different from BUG_ON(), but even > there Keir advocates not using expressions with side effects, aiui > both to avoid the above mistake (i.e. getting used to doing it the > right way) and to leave open the option of adding a build option to > eliminate the BUG()s and BUG_ON()s too. Yes, I don't know how I missed this! > > Jan > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel