This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] Re: [RFC PATCH 23/33] subarch TLB support

From: Chris Wright <chrisw@xxxxxxxxxxxx>
Date: Tue, 18 Jul 2006 00:00:23 -0700

> +        BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);

Although it happens to work currently, I think we should get out of
the habit of putting operations with wanted side effects into BUG_ON()
calls.  The following is therefore more preferable:

        ret = HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF);
        BUG_ON(ret < 0);

If this were ASSERT() in userspace, turning off debugging at build
time would make the evaluations inside of the macro never occur.  It
is my opinion that BUG_ON() should behave similarly.

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>