From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH] pci-attach: fix assertation Date: Wed, 16 Sep 2015 14:44:02 +0100 Message-ID: <1442411042.18856.65.camel@citrix.com> References: <1442384169-29059-1-git-send-email-cyliu@suse.com> <1442391925.18856.23.camel@citrix.com> <22009.28962.438024.593962@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <22009.28962.438024.593962@mariner.uk.xensource.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 Jackson Cc: wei.liu2@citrix.com, Chunyan Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2015-09-16 at 14:39 +0100, Ian Jackson wrote: > 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. Agreed, I just wanted to be sure there wasn't some magic reason to avoid XBT_NULL (other than, as you say, needless verbiage). > 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.) Right. > 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 > :-). Ack.