lkml.org 
[lkml]   [2012]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 1/4] dt: add of_get_child_count helper function
On Fri, Apr 27, 2012 at 12:24:11AM +0800, Stephen Warren wrote:
> On 04/26/2012 08:40 AM, Dong Aisheng wrote:
> > From: Dong Aisheng <dong.aisheng@linaro.org>
> >
> > 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.
>
Correct, i could change it.

Regards
Dong Aisheng



\
 
 \ /
  Last update: 2012-04-27 10:01    [from the cache]
©2003-2011 Jasper Spaans