From: Ian Campbell Subject: Re: [PATCH 1/4] dtb: correct handling of #address-cells and #size-cells. Date: Mon, 18 Feb 2013 13:25:55 +0000 Message-ID: <1361193955.31407.163.camel@zakaz.uk.xensource.com> References: <1359555969.12252.231.camel@zakaz.uk.xensource.com> <1359555990-12186-1-git-send-email-ian.campbell@citrix.com> <1360934328.31407.41.camel@zakaz.uk.xensource.com> <1360947870.31407.97.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: Anthony Perard , "Tim (Xen.org)" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Mon, 2013-02-18 at 13:11 +0000, Stefano Stabellini wrote: > On Fri, 15 Feb 2013, Ian Campbell wrote: > > > > > -u32 device_tree_get_u32(const void *fdt, int node, const char *prop_name) > > > > > +u32 device_tree_get_u32(const void *fdt, int node, const char *prop_name, > > > > > + u32 dflt) > > > > > { > > > > > const struct fdt_property *prop; > > > > > > > > > > prop = fdt_get_property(fdt, node, prop_name, NULL); > > > > > if ( !prop || prop->len < sizeof(u32) ) > > > > > - return 0; /* default to 0 */ > > > > > + return dflt; > > > > > > > > > > return fdt32_to_cpu(*(uint32_t*)prop->data); > > > > > } > > > > > > > > where did the vowels go? :) > > > > > > Not sure. Unlike me ;-) > > > > I remembered when I went to change it, default is a C keyword... > > I would have gone for _default, but I am OK with this too. Technically _default is reserved for the implementation (compiler or system libraries, I forget which). Ian.