Re: [PATCH] libfdt/tests: Add fdt_path_offset_namelen() test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Sun, Apr 05, 2015 at 12:05:56AM -0400, Peter Hurley wrote:
> Add unit test for fdt_path_offset_namelen(). Verify partial path-
> descending retrieves the same node offset as fdt_subnode_offset().
> Verify parsing correctness with multiple path separators, both
> mid-path and trailing.

Thanks for writing this.  However, looking at it, I find the way it's
doing the path splitting a bit impenetrable, and overly tied to the
expected usecase of fdt_path_offset_namelen() rather than just its
defined semantics.

Instead of merging this, I've merged your original
fdt_path_offset_namelen() patch, plus several patches which extend the
existing path_offset testcase to exercise fdt_path_offset_namelen()
and cover some other edge cases.

I did spot a case where the existing code is arguably incorrect: using
fdt_path_offset_namelen(fdt, "/somenode\0foo", 13) will return the
same as fdt_path_offset(fdt, "/somenode"), although I think ideally it
should always return -FDT_ERR_NOTFOUND, or some other error, since
node names can never include \0.

That's not an important enough problem to delay the patch though.  So,
fdt_path_offset_namelen() is merged and pushed up to the usual git
tree on kernel.org.

-- 
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: pgpupm5ERXtVV.pgp
Description: PGP signature


[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux