Prev: ARM defconfig files
Next: [PATCH 2/2] parport/serial: add support for Timedia/SUNIX cards to parport_serial
From: Grant Likely on 12 Jul 2010 12:00 On Tue, Jul 13, 2010 at 3:42 AM, Andres Salomon <dilinger(a)queued.net> wrote: > > Make is_root_node available for all archs to use, as it's not PROM-specific. > Also rename it to of_is_root_node, and a few other minor changes for > style/consistency. > > Signed-off-by: Andres Salomon <dilinger(a)queued.net> > --- > �arch/sparc/kernel/prom.h � � � �| � �8 -------- > �arch/sparc/kernel/prom_64.c � � | � �6 +++--- > �arch/sparc/kernel/prom_common.c | � �2 +- > �include/linux/of.h � � � � � � �| � �8 ++++++++ > �4 files changed, 12 insertions(+), 12 deletions(-) [...] > diff --git a/include/linux/of.h b/include/linux/of.h > index a367e19..b38cdf7 100644 > --- a/include/linux/of.h > +++ b/include/linux/of.h > @@ -97,6 +97,14 @@ extern struct device_node *of_node_get(struct device_node *node); > �extern void of_node_put(struct device_node *node); > �#endif > > +static inline bool of_is_root_node(const struct device_node *node) > +{ > + � � � if (!node) > + � � � � � � � return false; > + > + � � � return (node->parent == NULL); > +} Are you okay if I shorten this to? +static inline bool of_is_root_node(const struct device_node *node) +{ + return (node && (node->parent == NULL)); +} g. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Andres Salomon on 12 Jul 2010 12:30 On Mon, 12 Jul 2010 09:53:04 -0600 Grant Likely <grant.likely(a)secretlab.ca> wrote: > On Tue, Jul 13, 2010 at 3:42 AM, Andres Salomon <dilinger(a)queued.net> > wrote: > > > > Make is_root_node available for all archs to use, as it's not > > PROM-specific. Also rename it to of_is_root_node, and a few other > > minor changes for style/consistency. > > > > Signed-off-by: Andres Salomon <dilinger(a)queued.net> > > --- > > �arch/sparc/kernel/prom.h � � � �| � �8 -------- > > �arch/sparc/kernel/prom_64.c � � | � �6 +++--- > > �arch/sparc/kernel/prom_common.c | � �2 +- > > �include/linux/of.h � � � � � � �| � �8 ++++++++ > > �4 files changed, 12 insertions(+), 12 deletions(-) > [...] > > diff --git a/include/linux/of.h b/include/linux/of.h > > index a367e19..b38cdf7 100644 > > --- a/include/linux/of.h > > +++ b/include/linux/of.h > > @@ -97,6 +97,14 @@ extern struct device_node *of_node_get(struct > > device_node *node); extern void of_node_put(struct device_node > > *node); #endif > > > > +static inline bool of_is_root_node(const struct device_node *node) > > +{ > > + � � � if (!node) > > + � � � � � � � return false; > > + > > + � � � return (node->parent == NULL); > > +} > > Are you okay if I shorten this to? > > +static inline bool of_is_root_node(const struct device_node *node) > +{ > + return (node && (node->parent == NULL)); > +} > > g. It's fine with me. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: David Miller on 13 Jul 2010 00:20
From: Andres Salomon <dilinger(a)queued.net> Date: Tue, 13 Jul 2010 20:05:41 +0000 > On Mon, 12 Jul 2010 09:53:04 -0600 > Grant Likely <grant.likely(a)secretlab.ca> wrote: > >> On Tue, Jul 13, 2010 at 3:42 AM, Andres Salomon <dilinger(a)queued.net> >> wrote: >> > >> > Make is_root_node available for all archs to use, as it's not >> > PROM-specific. Also rename it to of_is_root_node, and a few other >> > minor changes for style/consistency. >> > >> > Signed-off-by: Andres Salomon <dilinger(a)queued.net> >> > --- >> > �arch/sparc/kernel/prom.h � � � �| � �8 -------- >> > �arch/sparc/kernel/prom_64.c � � | � �6 +++--- >> > �arch/sparc/kernel/prom_common.c | � �2 +- >> > �include/linux/of.h � � � � � � �| � �8 ++++++++ >> > �4 files changed, 12 insertions(+), 12 deletions(-) >> [...] >> > diff --git a/include/linux/of.h b/include/linux/of.h >> > index a367e19..b38cdf7 100644 >> > --- a/include/linux/of.h >> > +++ b/include/linux/of.h >> > @@ -97,6 +97,14 @@ extern struct device_node *of_node_get(struct >> > device_node *node); extern void of_node_put(struct device_node >> > *node); #endif >> > >> > +static inline bool of_is_root_node(const struct device_node *node) >> > +{ >> > + � � � if (!node) >> > + � � � � � � � return false; >> > + >> > + � � � return (node->parent == NULL); >> > +} >> >> Are you okay if I shorten this to? >> >> +static inline bool of_is_root_node(const struct device_node *node) >> +{ >> + return (node && (node->parent == NULL)); >> +} >> >> g. > > It's fine with me. > Me too: Acked-by: David S. Miller <davem(a)davemloft.net> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |