devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Peter Hurley <peter-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
Cc: Jon Loeliger <jdl-CYoMK+44s/E@public.gmane.org>,
	devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH] libfdt: Add fdt_path_offset_namelen()
Date: Fri, 13 Mar 2015 16:43:50 +1100	[thread overview]
Message-ID: <20150313054350.GA11132@voom.redhat.com> (raw)
In-Reply-To: <54FEF600.50402-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1906 bytes --]

On Tue, Mar 10, 2015 at 09:47:44AM -0400, Peter Hurley wrote:
> Hi David,
> 
> On 03/09/2015 08:17 PM, David Gibson wrote:
> > On Fri, Mar 06, 2015 at 10:12:38AM -0500, Peter Hurley wrote:
> >> Properties may contain path names which are not NUL-terminated.
> >> For example, the 'stdout-path' property allows the form 'path:options',
> >> where the ':' character terminates the path specifier.
> >>
> >> Allow these path names to be used in-place for path descending;
> >> add fdt_path_offset_namelen(), which limits the path name to 'namelen'
> >> characters.
> >>
> >> Reimplement fdt_path_offset() as a trivial wrapper.
> >>
> >> Signed-off-by: Peter Hurley <peter-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
> > 
> > I think this function is a good idea, however I would like to see a
> > testcase for it.
> 
> Sure, I can do that.
> 
> I assume you mean a path name with non-NUL termination because
> the fdt_path_offset() tests are already exercising the
> fdt_path_offset_name() implementation.

Yes, I mean the non-\0-terminated case.  Or more specifically still,
making sure that if you call fdt_path_offset_namelen() on a portion of
a longer path, it correctly gives you the offset for only the partial
path.

That said, there may be some other edge cases that could do with
testing too, if you have time.  In particular I'm thinking of paths
where there are repeated '/' character, and paths ending with one or
more '/' characters.

> Is there a readme somewhere regarding the test matrix (ie.,
> which dts files go with which tests)?

I'm afraid not, apart from the test runner script itself.  I'm not
sure quite what information you're after here.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2015-03-13  5:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-06 15:12 [PATCH] libfdt: Add fdt_path_offset_namelen() Peter Hurley
     [not found] ` <1425654758-2575-1-git-send-email-peter-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
2015-03-10  0:17   ` David Gibson
     [not found]     ` <20150310001711.GB30335-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2015-03-10 13:47       ` Peter Hurley
     [not found]         ` <54FEF600.50402-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
2015-03-13  5:43           ` David Gibson [this message]
     [not found]             ` <20150313054350.GA11132-1s0os16eZneny3qCrzbmXA@public.gmane.org>
2015-04-05  3:50               ` Peter Hurley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150313054350.GA11132@voom.redhat.com \
    --to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jdl-CYoMK+44s/E@public.gmane.org \
    --cc=peter-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).