From: "Jan Beulich" Subject: Re: [PATCH] Fix non-debug build after c/s 23767:80e9fcdaef36 Date: Mon, 22 Aug 2011 15:09:09 +0100 Message-ID: <4E527F2602000078000528EB@nat28.tlf.novell.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: George Dunlap , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org >>> On 22.08.11 at 15:35, Keir Fraser wrote: > George, >=20 > Would something like this work more generically for the non-debug case? >=20 > #define ASSERT(p) do { if (p); } while (0) I'd expect this to work, but the general expectation is that ASSERT() behaves as it does now (i.e. not evaluating its argument in NDEBUG builds), and making Xen deviate from that can certainly be expected to cause problems down the road (and would require auditing of all current uses of ASSERT()). Jan > -- Keir >=20 > On 22/08/2011 14:23, "George Dunlap" = wrote: >=20 >> The hd variable in iommu_update_pde_count() and iommu_merge_pages() is >> only used in the ASSERT, causing gcc to complain about the variable = being >> unused in non-debug builds. >>=20 >> Only define the variable for debug builds. >>=20 >> Signed-off-by: George Dunlap >>=20 >> diff -r 2029263c501c -r ac4de6b4c457 xen/drivers/passthrough/amd/iommu_m= ap.c >> --- a/xen/drivers/passthrough/amd/iommu_map.c Mon Aug 22 10:12:36 2011 = +0100 >> +++ b/xen/drivers/passthrough/amd/iommu_map.c Mon Aug 22 12:54:42 2011 = +0100 >> @@ -462,7 +462,9 @@ static int iommu_update_pde_count(struct >> unsigned long first_mfn; >> u64 *table, *pde, *ntable; >> u64 ntable_maddr, mask; >> +#ifndef NDEBUG >> struct hvm_iommu *hd =3D domain_hvm_iommu(d); >> +#endif >> bool_t ok =3D 0; >> =20 >> ASSERT( spin_is_locked(&hd->mapping_lock) && pt_mfn ); >> @@ -517,7 +519,9 @@ static int iommu_merge_pages(struct doma >> u64 *table, *pde, *ntable; >> u64 ntable_mfn; >> unsigned long first_mfn; >> +#ifndef NDEBUG >> struct hvm_iommu *hd =3D domain_hvm_iommu(d); >> +#endif >> =20 >> ASSERT( spin_is_locked(&hd->mapping_lock) && pt_mfn ); >> =20 >>=20 >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com=20 >> http://lists.xensource.com/xen-devel=20 >=20 >=20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com=20 > http://lists.xensource.com/xen-devel=20