Re: [PATCH v4] Add limited read-only support for older (V2 and V3) device tree to libfdt.

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



On Wed, Jan 24, 2018 at 11:13 PM,  <nwhitehorn@xxxxxxxxxxx> wrote:
> From: Nathan Whitehorn <nwhitehorn@xxxxxxxxxxx>
>
> This can be useful in particular in the kernel when booting on systems
> with FDT-emitting firmware that is out of date. Releases of kexec-tools
> on ppc64 prior to the end of 2014 are notable examples of such.
>
> Signed-off-by: Nathan Whitehorn <nwhitehorn@xxxxxxxxxxx>

[...]

> @@ -233,16 +234,34 @@ int fdt_path_offset(const void *fdt, const char *path)
>  const char *fdt_get_name(const void *fdt, int nodeoffset, int *len)
>  {
>         const struct fdt_node_header *nh = fdt_offset_ptr_(fdt, nodeoffset);
> +       const char *nameptr;
>         int err;
>
>         if (((err = fdt_check_header(fdt)) != 0)
>             || ((err = fdt_check_node_offset_(fdt, nodeoffset)) < 0))
>                         goto fail;
>
> +       nameptr = nh->name;
> +
> +       if (fdt_version(fdt) < 0x10) {
> +               /*
> +                * For old FDT versions, match the naming conventions of V16:
> +                * give only the leaf name (after all /). The actual tree
> +                * contents are loosely checked.
> +                */
> +               const char *leaf;
> +               leaf = strrchr(nameptr, '/');

strrchr is a new dependency which means for importing new libfdt into
the kernel I get to add 3 implementations of it (because early boot
code is not shared).

It would be nice if new dependencies were explicit somehow.

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



[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