Re: [PATCH 3/3] checks: Check node and property names are less than 32 characters

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



On Mon, Jun 18, 2018 at 12:49:37PM -0600, Rob Herring wrote:
> +devicetree-spec
> 
> On Sun, Jun 17, 2018 at 5:47 AM, David Gibson
> <david@xxxxxxxxxxxxxxxxxxxxx> wrote:
> > On Fri, Jun 15, 2018 at 03:37:16PM -0600, Rob Herring wrote:
> >> According to the DT Spec (and ePAPR), node and property names should be
> >> 1-31 characters.
> >>
> >> Signed-off-by: Rob Herring <robh@xxxxxxxxxx>
> >
> > I don't think this is a good idea.
> >
> >> ---
> >> Surprisingly, there aren't just a ton of warnings introduced with this.
> >> I'm not really sure where the 31 character limit came from. Maybe it
> >> should be increased rather than trying to fix any long names. Either
> >> way, we should have a check if there's a spec'ed limit.
> >
> > The 31 character limit comes from IEEE 1275.  But.. even long before
> > flattened trees, device trees from both IBM and Apple frequently
> > violated it.  I think we should probably just ditch this limitation
> > from the spec.
> 
> Having no limit means names are only limited by variable constraints
> of the cpu or OS/client and there's no way for the OS to know what the
> max is. In reality, we don't need *anywhere* close to what would be a
> maximum string length of a client. Do we really want it undefined in
> the spec? Don't know about IBM and Apple DTs, but just doubling the
> limit would eliminate all the warnings of the dts files in the kernel.
> 
> Even if it is not a spec limit, I think there should be a style or
> best practice limit. We already have that type of check for the
> character set, so why not the length?

Good points.  Yes, we should probably still have a limit, just a
larger one than current.  I'd be inclined to set it to 255 - it's
plenty long enough but still fits in 8-bits, which might be useful to
someone.

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


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

  Powered by Linux