devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC v3 0/3] Add aliases parsing to of_find_node_by_path()
@ 2014-03-14 17:11 Grant Likely
  2014-03-14 17:11 ` [RFC v3 1/3] of: Add a testcase for of_find_node_by_path() Grant Likely
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Grant Likely @ 2014-03-14 17:11 UTC (permalink / raw)
  To: linux-kernel, devicetree; +Cc: Pantelis Antoniou

Searching for a node by path should also take into account an /aliases
reference. This series reworks the of_find_node_by_path() code to handle
that use-case easily. It also makes it possible to start a search at a
child node, which Pantelis needs for the FDT overlay work.

I've done some simple testing on this series, but it needs a lot more
attention and the testcases can use beefing up.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [RFC v3 1/3] of: Add a testcase for of_find_node_by_path()
  2014-03-14 17:11 [RFC v3 0/3] Add aliases parsing to of_find_node_by_path() Grant Likely
@ 2014-03-14 17:11 ` Grant Likely
  2014-03-14 17:11 ` [RFC v3 2/3] lib: add glibc style strchrnul() variant Grant Likely
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Grant Likely @ 2014-03-14 17:11 UTC (permalink / raw)
  To: linux-kernel, devicetree; +Cc: Pantelis Antoniou, Grant Likely

Add a testcase for the find_node_by_path() function to make sure it
handles all the valid scenarios.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
---
 drivers/of/selftest.c                       | 39 +++++++++++++++++++++++++++++
 drivers/of/testcase-data/tests-phandle.dtsi |  6 ++++-
 2 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/drivers/of/selftest.c b/drivers/of/selftest.c
index ae4450070503..f5b4dcffbe32 100644
--- a/drivers/of/selftest.c
+++ b/drivers/of/selftest.c
@@ -30,6 +30,43 @@ static struct selftest_results {
 	} \
 }
 
+static void __init of_selftest_find_node_by_name(void)
+{
+	struct device_node *np;
+
+	np = of_find_node_by_path("/testcase-data");
+	selftest(np && !strcmp("/testcase-data", np->full_name),
+		"find /testcase-data failed\n");
+	of_node_put(np);
+
+	np = of_find_node_by_path("/testcase-data/phandle-tests/consumer-a");
+	selftest(np && !strcmp("/testcase-data/phandle-tests/consumer-a", np->full_name),
+		"find /testcase-data/phandle-tests/consumer-a failed\n");
+	of_node_put(np);
+
+	np = of_find_node_by_path("testcase-alias");
+	selftest(np && !strcmp("/testcase-data", np->full_name),
+		"find testcase-alias failed\n");
+	of_node_put(np);
+
+	np = of_find_node_by_path("testcase-alias/phandle-tests/consumer-a");
+	selftest(np && !strcmp("/testcase-data/phandle-tests/consumer-a", np->full_name),
+		"find testcase-alias/phandle-tests/consumer-a failed\n");
+	of_node_put(np);
+
+	np = of_find_node_by_path("/testcase-data/missing-path");
+	selftest(!np, "non-existent path returned node %s\n", np->full_name);
+	of_node_put(np);
+
+	np = of_find_node_by_path("missing-alias");
+	selftest(!np, "non-existent alias returned node %s\n", np->full_name);
+	of_node_put(np);
+
+	np = of_find_node_by_path("testcase-alias/missing-path");
+	selftest(!np, "non-existent alias with relative path returned node %s\n", np->full_name);
+	of_node_put(np);
+}
+
 static void __init of_selftest_dynamic(void)
 {
 	struct device_node *np;
@@ -89,6 +126,7 @@ static void __init of_selftest_dynamic(void)
 	if (prop->value)
 		selftest(of_add_property(np, prop) == 0,
 			 "Adding a large property should have passed\n");
+
 }
 
 static void __init of_selftest_parse_phandle_with_args(void)
@@ -439,6 +477,7 @@ static int __init of_selftest(void)
 	of_node_put(np);
 
 	pr_info("start of selftest - you will see error messages\n");
+	of_selftest_find_node_by_name();
 	of_selftest_dynamic();
 	of_selftest_parse_phandle_with_args();
 	of_selftest_property_match_string();
diff --git a/drivers/of/testcase-data/tests-phandle.dtsi b/drivers/of/testcase-data/tests-phandle.dtsi
index 788a4c24b8f5..ce0fe083d406 100644
--- a/drivers/of/testcase-data/tests-phandle.dtsi
+++ b/drivers/of/testcase-data/tests-phandle.dtsi
@@ -1,6 +1,10 @@
 
 / {
-	testcase-data {
+	aliases {
+		testcase-alias = &testcase;
+	};
+
+	testcase: testcase-data {
 		security-password = "password";
 		duplicate-name = "duplicate";
 		duplicate-name { };
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [RFC v3 2/3] lib: add glibc style strchrnul() variant
  2014-03-14 17:11 [RFC v3 0/3] Add aliases parsing to of_find_node_by_path() Grant Likely
  2014-03-14 17:11 ` [RFC v3 1/3] of: Add a testcase for of_find_node_by_path() Grant Likely
@ 2014-03-14 17:11 ` Grant Likely
  2014-03-14 17:11 ` [RFC v3 3/3] of: Make of_find_node_by_path() handle /aliases Grant Likely
       [not found] ` < 1394817109-26199-4-git-send-email-grant.likely@linaro.org>
  3 siblings, 0 replies; 7+ messages in thread
From: Grant Likely @ 2014-03-14 17:11 UTC (permalink / raw)
  To: linux-kernel, devicetree; +Cc: Pantelis Antoniou, Grant Likely

The strchrnul() variant helpfully returns a the end of the string
instead of a NULL if the requested character is not found. This can
simplify string parsing code since it doesn't need to expicitly check
for a NULL return. If a valid string pointer is passed in, then a valid
null terminated string will always come back out.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
---
 include/linux/string.h |  3 +++
 lib/string.c           | 15 +++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/include/linux/string.h b/include/linux/string.h
index ac889c5ea11b..d36977e029af 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -52,6 +52,9 @@ extern int strncasecmp(const char *s1, const char *s2, size_t n);
 #ifndef __HAVE_ARCH_STRCHR
 extern char * strchr(const char *,int);
 #endif
+#ifndef __HAVE_ARCH_STRCHRNUL
+extern char * strchrnul(const char *,int);
+#endif
 #ifndef __HAVE_ARCH_STRNCHR
 extern char * strnchr(const char *, size_t, int);
 #endif
diff --git a/lib/string.c b/lib/string.c
index e5878de4f101..879e839cc555 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -301,6 +301,21 @@ char *strchr(const char *s, int c)
 EXPORT_SYMBOL(strchr);
 #endif
 
+#ifndef __HAVE_ARCH_STRCHRNUL
+/**
+ * strchr - Find the first occurrence of a character in a string
+ * @s: The string to be searched
+ * @c: The character to search for
+ */
+char *strchrnul(const char *s, int c)
+{
+	while (*s && *s != (char)c)
+		s++;
+	return (char *)s;
+}
+EXPORT_SYMBOL(strchrnul);
+#endif
+
 #ifndef __HAVE_ARCH_STRRCHR
 /**
  * strrchr - Find the last occurrence of a character in a string
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [RFC v3 3/3] of: Make of_find_node_by_path() handle /aliases
  2014-03-14 17:11 [RFC v3 0/3] Add aliases parsing to of_find_node_by_path() Grant Likely
  2014-03-14 17:11 ` [RFC v3 1/3] of: Add a testcase for of_find_node_by_path() Grant Likely
  2014-03-14 17:11 ` [RFC v3 2/3] lib: add glibc style strchrnul() variant Grant Likely
@ 2014-03-14 17:11 ` Grant Likely
  2014-03-14 21:39   ` Rob Herring
       [not found] ` < 1394817109-26199-4-git-send-email-grant.likely@linaro.org>
  3 siblings, 1 reply; 7+ messages in thread
From: Grant Likely @ 2014-03-14 17:11 UTC (permalink / raw)
  To: linux-kernel, devicetree; +Cc: Pantelis Antoniou, Grant Likely, David Daney

Make of_find_node_by_path() handle aliases as prefixes. To make this
work the name search is refactored to search by path component instead
of by full string. This should be a more efficient search, and it makes
it possible to start a search at a subnode of a tree.

Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
[grant.likely: Rework to not require allocating at runtime]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
---
 drivers/of/base.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 56 insertions(+), 4 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 7083fad079a6..b8b673526dbd 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -770,9 +770,38 @@ struct device_node *of_get_child_by_name(const struct device_node *node,
 }
 EXPORT_SYMBOL(of_get_child_by_name);
 
+static struct device_node *__of_find_node_by_path(struct device_node *parent,
+						const char *path)
+{
+	struct device_node *child;
+	int len = strchrnul(path, '/') - path;
+
+	if (!len)
+		return parent;
+
+	for_each_child_of_node(parent, child) {
+		const char *name = strrchr(child->full_name, '/');
+		if (WARN(!name, "malformed device_node %s\n", child->full_name))
+			continue;
+		name++;
+		if (strncmp(path, name, len) == 0 && (strlen(name) == len))
+			return child;
+	}
+	return NULL;
+}
+
 /**
  *	of_find_node_by_path - Find a node matching a full OF path
  *	@path:	The full path to match
+ *	@path: Either the full path to match, or if the path does not
+ *	       start with '/', the name of a property of the /aliases
+ *	       node (an alias).  In the case of an alias, the node
+ *	       matching the alias' value will be returned.
+ *
+ *	Valid paths:
+ *		/foo/bar	Full path
+ *		foo		Valid alias
+ *		foo/bar		Valid alias + relative path
  *
  *	Returns a node pointer with refcount incremented, use
  *	of_node_put() on it when done.
@@ -780,13 +809,36 @@ EXPORT_SYMBOL(of_get_child_by_name);
 struct device_node *of_find_node_by_path(const char *path)
 {
 	struct device_node *np = of_allnodes;
+	struct property *pp;
 	unsigned long flags;
 
+	/* The path could begin with an alias */
+	if (*path != '/') {
+		char *p = strchrnul(path, '/');
+		int len = p - path;
+
+		/* of_aliases must not be NULL */
+		if (!of_aliases)
+			return NULL;
+
+		np = NULL;
+		for_each_property_of_node(of_aliases, pp) {
+			if (strlen(pp->name) == len && !strncmp(pp->name, path, len)) {
+				np = of_find_node_by_path(pp->value);
+				break;
+			}
+		}
+		if (!np)
+			return NULL;
+		path = p;
+	}
+
+	/* Step down the tree matching path components */
 	raw_spin_lock_irqsave(&devtree_lock, flags);
-	for (; np; np = np->allnext) {
-		if (np->full_name && (of_node_cmp(np->full_name, path) == 0)
-		    && of_node_get(np))
-			break;
+	while (np && *path == '/') {
+		path++; /* Increment past '/' delimiter */
+		np = __of_find_node_by_path(np, path);
+		path = strchrnul(path, '/');
 	}
 	raw_spin_unlock_irqrestore(&devtree_lock, flags);
 	return np;
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [RFC v3 3/3] of: Make of_find_node_by_path() handle /aliases
  2014-03-14 17:11 ` [RFC v3 3/3] of: Make of_find_node_by_path() handle /aliases Grant Likely
@ 2014-03-14 21:39   ` Rob Herring
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2014-03-14 21:39 UTC (permalink / raw)
  To: Grant Likely
  Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	Pantelis Antoniou, David Daney

On Fri, Mar 14, 2014 at 12:11 PM, Grant Likely <grant.likely@linaro.org> wrote:
> Make of_find_node_by_path() handle aliases as prefixes. To make this
> work the name search is refactored to search by path component instead
> of by full string. This should be a more efficient search, and it makes
> it possible to start a search at a subnode of a tree.
>
> Signed-off-by: David Daney <david.daney@cavium.com>
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
> [grant.likely: Rework to not require allocating at runtime]
> Signed-off-by: Grant Likely <grant.likely@linaro.org>

I should have read the comments before trying to figure out why you
had that "pointless" recursion...

Acked-by: Rob Herring <robh@kernel.org>

> ---
>  drivers/of/base.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++----
>  1 file changed, 56 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 7083fad079a6..b8b673526dbd 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -770,9 +770,38 @@ struct device_node *of_get_child_by_name(const struct device_node *node,
>  }
>  EXPORT_SYMBOL(of_get_child_by_name);
>
> +static struct device_node *__of_find_node_by_path(struct device_node *parent,
> +                                               const char *path)
> +{
> +       struct device_node *child;
> +       int len = strchrnul(path, '/') - path;
> +
> +       if (!len)
> +               return parent;
> +
> +       for_each_child_of_node(parent, child) {
> +               const char *name = strrchr(child->full_name, '/');
> +               if (WARN(!name, "malformed device_node %s\n", child->full_name))
> +                       continue;
> +               name++;
> +               if (strncmp(path, name, len) == 0 && (strlen(name) == len))
> +                       return child;
> +       }
> +       return NULL;
> +}
> +
>  /**
>   *     of_find_node_by_path - Find a node matching a full OF path
>   *     @path:  The full path to match
> + *     @path: Either the full path to match, or if the path does not
> + *            start with '/', the name of a property of the /aliases
> + *            node (an alias).  In the case of an alias, the node
> + *            matching the alias' value will be returned.
> + *
> + *     Valid paths:
> + *             /foo/bar        Full path
> + *             foo             Valid alias
> + *             foo/bar         Valid alias + relative path
>   *
>   *     Returns a node pointer with refcount incremented, use
>   *     of_node_put() on it when done.
> @@ -780,13 +809,36 @@ EXPORT_SYMBOL(of_get_child_by_name);
>  struct device_node *of_find_node_by_path(const char *path)
>  {
>         struct device_node *np = of_allnodes;
> +       struct property *pp;
>         unsigned long flags;
>
> +       /* The path could begin with an alias */
> +       if (*path != '/') {
> +               char *p = strchrnul(path, '/');
> +               int len = p - path;
> +
> +               /* of_aliases must not be NULL */
> +               if (!of_aliases)
> +                       return NULL;
> +
> +               np = NULL;
> +               for_each_property_of_node(of_aliases, pp) {
> +                       if (strlen(pp->name) == len && !strncmp(pp->name, path, len)) {
> +                               np = of_find_node_by_path(pp->value);
> +                               break;
> +                       }
> +               }
> +               if (!np)
> +                       return NULL;
> +               path = p;
> +       }
> +
> +       /* Step down the tree matching path components */
>         raw_spin_lock_irqsave(&devtree_lock, flags);
> -       for (; np; np = np->allnext) {
> -               if (np->full_name && (of_node_cmp(np->full_name, path) == 0)
> -                   && of_node_get(np))
> -                       break;
> +       while (np && *path == '/') {
> +               path++; /* Increment past '/' delimiter */
> +               np = __of_find_node_by_path(np, path);
> +               path = strchrnul(path, '/');
>         }
>         raw_spin_unlock_irqrestore(&devtree_lock, flags);
>         return np;
> --
> 1.8.3.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC v3 3/3] of: Make of_find_node_by_path() handle /aliases
       [not found]     ` <CAL_JsqLtYFiLnLgdN_GMG33JD53wFdyfhCwLHek3tLBbQB7maQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-03-15 12:33       ` Grant Likely
       [not found]         ` <20140315123331.7351DC40A1B-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Grant Likely @ 2014-03-15 12:33 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Pantelis Antoniou, David Daney

On Fri, 14 Mar 2014 16:39:38 -0500, Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Fri, Mar 14, 2014 at 12:11 PM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> > Make of_find_node_by_path() handle aliases as prefixes. To make this
> > work the name search is refactored to search by path component instead
> > of by full string. This should be a more efficient search, and it makes
> > it possible to start a search at a subnode of a tree.
> >
> > Signed-off-by: David Daney <david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
> > Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> > [grant.likely: Rework to not require allocating at runtime]
> > Signed-off-by: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> 
> I should have read the comments before trying to figure out why you
> had that "pointless" recursion...

Hi Rob,

Thanks for the review. However, I'm a little slow this morning and I
don't understand what you mean. Did I miss an early comment?

g.

> 
> Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> 
> > ---
> >  drivers/of/base.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++----
> >  1 file changed, 56 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/of/base.c b/drivers/of/base.c
> > index 7083fad079a6..b8b673526dbd 100644
> > --- a/drivers/of/base.c
> > +++ b/drivers/of/base.c
> > @@ -770,9 +770,38 @@ struct device_node *of_get_child_by_name(const struct device_node *node,
> >  }
> >  EXPORT_SYMBOL(of_get_child_by_name);
> >
> > +static struct device_node *__of_find_node_by_path(struct device_node *parent,
> > +                                               const char *path)
> > +{
> > +       struct device_node *child;
> > +       int len = strchrnul(path, '/') - path;
> > +
> > +       if (!len)
> > +               return parent;
> > +
> > +       for_each_child_of_node(parent, child) {
> > +               const char *name = strrchr(child->full_name, '/');
> > +               if (WARN(!name, "malformed device_node %s\n", child->full_name))
> > +                       continue;
> > +               name++;
> > +               if (strncmp(path, name, len) == 0 && (strlen(name) == len))
> > +                       return child;
> > +       }
> > +       return NULL;
> > +}
> > +
> >  /**
> >   *     of_find_node_by_path - Find a node matching a full OF path
> >   *     @path:  The full path to match
> > + *     @path: Either the full path to match, or if the path does not
> > + *            start with '/', the name of a property of the /aliases
> > + *            node (an alias).  In the case of an alias, the node
> > + *            matching the alias' value will be returned.
> > + *
> > + *     Valid paths:
> > + *             /foo/bar        Full path
> > + *             foo             Valid alias
> > + *             foo/bar         Valid alias + relative path
> >   *
> >   *     Returns a node pointer with refcount incremented, use
> >   *     of_node_put() on it when done.
> > @@ -780,13 +809,36 @@ EXPORT_SYMBOL(of_get_child_by_name);
> >  struct device_node *of_find_node_by_path(const char *path)
> >  {
> >         struct device_node *np = of_allnodes;
> > +       struct property *pp;
> >         unsigned long flags;
> >
> > +       /* The path could begin with an alias */
> > +       if (*path != '/') {
> > +               char *p = strchrnul(path, '/');
> > +               int len = p - path;
> > +
> > +               /* of_aliases must not be NULL */
> > +               if (!of_aliases)
> > +                       return NULL;
> > +
> > +               np = NULL;
> > +               for_each_property_of_node(of_aliases, pp) {
> > +                       if (strlen(pp->name) == len && !strncmp(pp->name, path, len)) {
> > +                               np = of_find_node_by_path(pp->value);
> > +                               break;
> > +                       }
> > +               }
> > +               if (!np)
> > +                       return NULL;
> > +               path = p;
> > +       }
> > +
> > +       /* Step down the tree matching path components */
> >         raw_spin_lock_irqsave(&devtree_lock, flags);
> > -       for (; np; np = np->allnext) {
> > -               if (np->full_name && (of_node_cmp(np->full_name, path) == 0)
> > -                   && of_node_get(np))
> > -                       break;
> > +       while (np && *path == '/') {
> > +               path++; /* Increment past '/' delimiter */
> > +               np = __of_find_node_by_path(np, path);
> > +               path = strchrnul(path, '/');
> >         }
> >         raw_spin_unlock_irqrestore(&devtree_lock, flags);
> >         return np;
> > --
> > 1.8.3.2
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe devicetree" in
> > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC v3 3/3] of: Make of_find_node_by_path() handle /aliases
       [not found]         ` <20140315123331.7351DC40A1B-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
@ 2014-03-15 19:44           ` Rob Herring
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2014-03-15 19:44 UTC (permalink / raw)
  To: Grant Likely
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Pantelis Antoniou, David Daney

On Sat, Mar 15, 2014 at 7:33 AM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> On Fri, 14 Mar 2014 16:39:38 -0500, Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On Fri, Mar 14, 2014 at 12:11 PM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>> > Make of_find_node_by_path() handle aliases as prefixes. To make this
>> > work the name search is refactored to search by path component instead
>> > of by full string. This should be a more efficient search, and it makes
>> > it possible to start a search at a subnode of a tree.
>> >
>> > Signed-off-by: David Daney <david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
>> > Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
>> > [grant.likely: Rework to not require allocating at runtime]
>> > Signed-off-by: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>>
>> I should have read the comments before trying to figure out why you
>> had that "pointless" recursion...
>
> Hi Rob,
>
> Thanks for the review. However, I'm a little slow this morning and I
> don't understand what you mean. Did I miss an early comment?

No, it's me that was being slow. At first glance I was thinking the
recursion was pointless until I saw the alias + path case.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-03-15 19:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-14 17:11 [RFC v3 0/3] Add aliases parsing to of_find_node_by_path() Grant Likely
2014-03-14 17:11 ` [RFC v3 1/3] of: Add a testcase for of_find_node_by_path() Grant Likely
2014-03-14 17:11 ` [RFC v3 2/3] lib: add glibc style strchrnul() variant Grant Likely
2014-03-14 17:11 ` [RFC v3 3/3] of: Make of_find_node_by_path() handle /aliases Grant Likely
2014-03-14 21:39   ` Rob Herring
     [not found] ` < 1394817109-26199-4-git-send-email-grant.likely@linaro.org>
     [not found]   ` < CAL_JsqLtYFiLnLgdN_GMG33JD53wFdyfhCwLHek3tLBbQB7maQ@mail.gmail.com>
     [not found]     ` <CAL_JsqLtYFiLnLgdN_GMG33JD53wFdyfhCwLHek3tLBbQB7maQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-15 12:33       ` Grant Likely
     [not found]         ` <20140315123331.7351DC40A1B-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-03-15 19:44           ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).