From: Ian Campbell Subject: Re: [PATCH 05/11] device tree: add device_tree_for_each_node() Date: Thu, 22 Mar 2012 11:12:01 +0000 Message-ID: <1332414721.8817.67.camel@zakaz.uk.xensource.com> References: <1332179529-1828-1-git-send-email-david.vrabel@citrix.com> <1332179529-1828-6-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1332179529-1828-6-git-send-email-david.vrabel@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: David Vrabel Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Mon, 2012-03-19 at 17:52 +0000, David Vrabel wrote: > + for ( node = 0, depth = 0; > + node >=0 && depth >= 0; > + node = fdt_next_node(fdt, node, &depth) ) > + { > + if ( depth >= MAX_DEPTH ) > + continue; Perhaps we should fail and return an error here (which the caller can log with whatever facilities are available, e.g. early_printk or printk)? Silently just not walking a bit of the tree seem liable to lead to odd errors... Ian.