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


Re: [Xen-devel] cpu_*(), #define, and &

To: George Dunlap <dunlapg@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] cpu_*(), #define, and &
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Mon, 21 Sep 2009 18:03:53 +0100
Delivery-date: Mon, 21 Sep 2009 10:04:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <de76405a0909210949p7e9c7f42xc25c974d29f8844a@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Aco624EOScalLx1zT+2XdZ6UePIYvAAAf4qf
Thread-topic: [Xen-devel] cpu_*(), #define, and &
User-agent: Microsoft-Entourage/
On 21/09/2009 17:49, "George Dunlap" <dunlapg@xxxxxxxxx> wrote:

> I hope I'm not bikeshedding here
> (http://catb.org/jargon/html/B/bikeshedding.html), but I'm not really
> happy with the cpu_*() macros in cpumask.h adding ampersands before
> the arguments.  In C (as opposed to C++), passing a non-pointer
> generally means that no values are going to be changed.  Other than
> Linux similarity, is there a good reason to do this in a macro, rather
> than just having the caller provide the &?  Would anyone object to me
> submitting a patch to change that?
> (A patch to change it looks to be rather big and boring, so I want to
> talk about it first before doing it...)

I somewhat agree about the pointless macro-ification in cpumask.h, but I
don't care enough about this to diverge from the original Linux definitions.
The cpumask macros which modify the given mask are named to make it pretty
obvious. We'll live with it; it's not really that annoying.

 -- Keir

Xen-devel mailing list

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