From: Ian Jackson Subject: Re: [PATCH] pci-attach: fix assertation Date: Wed, 16 Sep 2015 14:39:46 +0100 Message-ID: <22009.28962.438024.593962@mariner.uk.xensource.com> References: <1442384169-29059-1-git-send-email-cyliu@suse.com> <1442391925.18856.23.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1442391925.18856.23.camel@citrix.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: Ian Campbell Cc: wei.liu2@citrix.com, Chunyan Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [PATCH] pci-attach: fix assertation"): > Ian, tools/libxl/libxl_internal.h says to initialised the transaction to 0 > rather than XBT_NULL explicitly -- I don't think there is a specific reason > for that though? It says: /* Transaction functions, best used together. * The caller should initialise *t to 0 (XBT_NULL) before calling start. I think that amounts to a promise that XBT_NULL == 0. Therefore the caller may (from a correctness pov) use either. It is important that initialisation with 0 is supported because then FILLZERO is known to DTRT. (Note that, analogously, we are already assuming that FILLZERO generates null pointers.) I know that some people have strong views that writing NULL for null pointers, rather than 0, is better. I think it is needless verbiage. A similar argument applies to XBT_NULL. I think this is a bikeshed and am happy to let it be whatever colour it comes from the factory :-). Ian.