Re: [PATCH 1/1] libfdt: Change last_comp_version to fit spec

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



On Mon, Nov 30, 2020 at 10:22:09AM -0700, Rob Herring wrote:
> On Tue, Nov 24, 2020 at 10:50 AM Justin Covell <jujugoboom@xxxxxxxxx> wrote:
> >
> 
> Needs a commit message. For a single patch, you don't need a cover
> letter. The explanation should be here.
>
> Besides matching the spec, what problem are you trying to solve?
>

Sorry about that, first time contributing. I'm trying to help with
interoperability with other libraries that are made to read/write DTBs
by matching the spec.

> > ---
> >  libfdt/fdt_sw.c | 2 +-
> >  libfdt/libfdt.h | 1 +
> >  2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/libfdt/fdt_sw.c b/libfdt/fdt_sw.c
> > index 68b543c..4c569ee 100644
> > --- a/libfdt/fdt_sw.c
> > +++ b/libfdt/fdt_sw.c
> > @@ -377,7 +377,7 @@ int fdt_finish(void *fdt)
> >         fdt_set_totalsize(fdt, newstroffset + fdt_size_dt_strings(fdt));
> >
> >         /* And fix up fields that were keeping intermediate state. */
> > -       fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION);
> > +       fdt_set_last_comp_version(fdt, FDT_LAST_COMPATIBLE_VERSION);
> >         fdt_set_magic(fdt, FDT_MAGIC);
> >
> >         return 0;
> > diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h
> > index 89adee3..abad93b 100644
> > --- a/libfdt/libfdt.h
> > +++ b/libfdt/libfdt.h
> > @@ -14,6 +14,7 @@ extern "C" {
> >  #endif
> >
> >  #define FDT_FIRST_SUPPORTED_VERSION    0x02
> > +#define FDT_LAST_COMPATIBLE_VERSION 0x10
> 
> If the above change is correct (I'm not sure it is offhand), why not
> just bump up FDT_FIRST_SUPPORTED_VERSION value?
> 

I didn't want to bump the FDT_FIRST_SUPPORTED_VERSION to maintin
backwards compatability, and assumed that libfdt actually does support
working with DTBs down to version 2.

> >  #define FDT_LAST_SUPPORTED_VERSION     0x11
> >
> >  /* Error codes: informative error codes */
> > --
> > 2.25.1
> >



[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