From mboxrd@z Thu Jan 1 00:00:00 1970 From: swarren@wwwdotorg.org (Stephen Warren) Date: Thu, 26 Apr 2012 10:24:11 -0600 Subject: [PATCH v4 1/4] dt: add of_get_child_count helper function In-Reply-To: <1335451227-27709-1-git-send-email-b29396@freescale.com> References: <1335451227-27709-1-git-send-email-b29396@freescale.com> Message-ID: <4F9976AB.1020502@wwwdotorg.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 04/26/2012 08:40 AM, Dong Aisheng wrote: > From: Dong Aisheng > > Currently most code to get child count in kernel are almost same, > add a helper to implement this function for dt to use. > diff --git a/include/linux/of.h b/include/linux/of.h > +static inline int of_get_child_count(const struct device_node *np) > +{ > + struct device_node *child = NULL; You don't actually need to initialize child here. It doesn't really matter here, but in a more complex function, it might hide a used-before-initialized error.