From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Likely Subject: Re: [PATCH] of: re-use kernel's kbasename() Date: Wed, 31 Oct 2012 16:42:32 +0100 Message-ID: References: <1351690226-28152-1-git-send-email-andriy.shevchenko@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1351690226-28152-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Andy Shevchenko Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Rob Herring List-Id: devicetree@vger.kernel.org On Wed, Oct 31, 2012 at 2:30 PM, Andy Shevchenko wrote: > Signed-off-by: Andy Shevchenko > Cc: Grant Likely > Cc: Rob Herring Acked-by: Grant Likely Please merge through the same tree that adds the new kbasename function. g. > --- > drivers/of/fdt.c | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c > index 91a375f..0ca0f9e 100644 > --- a/drivers/of/fdt.c > +++ b/drivers/of/fdt.c > @@ -486,14 +486,8 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node, > depth++; > pathp = (char *)p; > p = ALIGN(p + strlen(pathp) + 1, 4); > - if ((*pathp) == '/') { > - char *lp, *np; > - for (lp = NULL, np = pathp; *np; np++) > - if ((*np) == '/') > - lp = np+1; > - if (lp != NULL) > - pathp = lp; > - } > + if (*pathp == '/') > + pathp = kbasename(pathp); > rc = it(p, pathp, depth, data); > if (rc != 0) > break; > -- > 1.7.10.4 > -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.