From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: John Bonesio <bones-RkXMcIGFT/TR7s880joybQ@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: Re: Proposal: new device-tree syntax and semantics for extending information from included dts files
Date: Thu, 14 Oct 2010 15:00:39 +1100 [thread overview]
Message-ID: <20101014040039.GI4456@yookeroo> (raw)
In-Reply-To: <1287025692.4535.1348.camel@riker>
On Wed, Oct 13, 2010 at 08:08:12PM -0700, John Bonesio wrote:
> On Wed, 2010-10-13 at 19:40 -0600, Grant Likely wrote:
> > On Thu, Oct 14, 2010 at 11:38:33AM +1100, David Gibson wrote:
> > > On Wed, Oct 13, 2010 at 05:17:47PM -0600, Grant Likely wrote:
> > > > On Tue, Oct 12, 2010 at 02:56:01PM -0700, John Bonesio wrote:
[snip]
> > > > > B) /replace/
> > > >
> > > > /replace-node/ perhaps?
> > >
> > > There is no need for this. It's equivalent to a /remove/ then an
> > > /extend/, which is barely more verbose.
> >
> > Need to flush this out. What would this look like then? This?
> >
> > &some-node {
> > node-to-remove /remove/;
> >
> > node-to-replace /remove/;
> > node-to-replace { prop = "blah"; };
> > };
> >
> > I don't like this one because it implies ordering between the first
> > and second 'node-to-replace' definitions, and to this point the syntax
> > has not imposed any order assumptions.
> >
> > Perhaps this:
> >
> > &some-node {
> > node-to-remove /remove/;
> > node-to-replace /remove/ { prop = "blah"; };
> > };
>
> I think this is going to be really confusing. A person looking at this
> for the first time will be wondering, "Why are we removing property,
> 'prop'. I thought we needed that one?"
>
> I believe that if we want to be able to replace nodes, we should stick
> with the /replace/ syntax.
>
> The dts syntax is meant for humans to read, otherwise, we'd just encode
> the bits in the dtb file by hand. The new syntax and semantics doesn't
Well, it's meant for programmers (specifically, C programmers) to read..
> have to be reduced to provide only one way to do each thing. I believe
> we should optimize for human readability.
It's because of readability that I want to get rid of duplicate syntax
with identical semantics. That leads readers to go "what's the
difference" when there is none.
> My vote is to go ahead with the 3 methods of modifying existing nodes
> which is /extend/, /replace/, and /remove/. Use of the /extend/ syntax,
> while optional as this is the default, should still be allowed in the
> case where most of the updates are using the other methods and for
> clarity, the writer wants to make /extend/ explicit.
Nack. Any new syntax we're stuck with more-or-less forever. I know
you and others want these features, but adding new syntax without more
than half a day's attempt to reach consensus is not wise.
[snip]
> > &some-node {
> > /remove-prop/ property-to-remove;
> > property-to-replace = "new value";
> > property-to-replace-with-empty-prop;
> >
> > /remove-node/ node-to-remove;
> > /remove-node/ node-to-replace { prop = "blah"; };
> > };
> >
> > And the following construct would be forbidden:
> >
> > /remove-prop/ property-to-remove = "new value;
>
> Do we need to be able to set a property with an empty value?
Yes, absolutely. Empty valued properties (which are distinct from
non-existent properties) are used routinely in real trees.
> I'm wondering if we have /remove-node/ and /remove-property/ if it
> will lead people to make errors by accidentally using the wrong
> syntax for the node or property.
You mean this?
/remove-node/ some-property;
Not that likely an error, IMO. And more to the point it will just
generate a syntax error for which we can easily provide an error
message pointing directly at the mistake. It's not mistakes which
lead the compiler to reject the input which are scary, it's the ones
which will silently produce a valid tree that's not the one you
expected.
> If we're not going to use
> property-to-remove = /undefined/;
>
> then I'd prefer if we used /remove/ for both nodes and properties.
>
> I'm not sure about having the keyword in front for properties and
> afterwards for nodes. I think we want the syntactic rules to be very
> simple and easy to remember.
Um.. I don't think that was ever suggested. Although if using an
explicit preceding /remove/ for nodes and '= /undefined/' for props
that's kind of the same thing but the other way around.
--
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
next prev parent reply other threads:[~2010-10-14 4:00 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1286920561.4535.1315.camel@riker>
2010-10-13 23:17 ` Proposal: new device-tree syntax and semantics for extending information from included dts files Grant Likely
[not found] ` <20101013231747.GD15286-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-10-13 23:41 ` Proposal: new device-tree syntax and semantics for extendinginformation " Stephen Neuendorffer
[not found] ` <d223e561-ed6e-44c2-8a99-8959e85ae022-+Ck8Kgl/v0/nHLUNXTEFU7jjLBE8jN/0@public.gmane.org>
2010-10-14 0:45 ` David Gibson
2010-10-14 1:46 ` Grant Likely
[not found] ` <20101014014657.GF15286-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-10-14 3:31 ` David Gibson
2010-10-14 16:38 ` Stephen Neuendorffer
[not found] ` <21eeaef0-fc78-47c9-b1c5-bfefaa55fb85-RaUQJvECHis6W+Ha+8ZLibjjLBE8jN/0@public.gmane.org>
2010-10-15 15:18 ` Grant Likely
[not found] ` <20101015151840.GB32705-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-10-15 16:10 ` Stephen Neuendorffer
[not found] ` <b04d95cc-c35b-4597-8fbe-f7c48f23ef92-+Ck8Kgl/v09DUMyIFHz4objjLBE8jN/0@public.gmane.org>
2010-10-15 19:32 ` Grant Likely
[not found] ` <AANLkTinPWv94Xoz+mDxiE=KujQYAyQj9PsPWHEORypJ3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-15 19:48 ` Stephen Neuendorffer
[not found] ` <eba820f8-3e4f-4d57-9024-39cc562a99eb-+Ck8Kgl/v0/0H8R8xLlBI7jjLBE8jN/0@public.gmane.org>
2010-10-15 19:56 ` Grant Likely
[not found] ` <AANLkTikWfMXEbdwFY6FNoMwuD6fC74Kohtr3QRJqSrM0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-15 19:59 ` Stephen Neuendorffer
[not found] ` <ed27a45d-3607-41e3-831f-1d7e3dd44379-RaUQJvECHis6W+Ha+8ZLibjjLBE8jN/0@public.gmane.org>
2010-10-15 20:11 ` Grant Likely
[not found] ` <AANLkTikzyDFiQZzPmeos6pf_DS33RvkfER+Mz0jceSJy-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-15 20:20 ` Stephen Neuendorffer
[not found] ` <4da0557a-d204-4e38-8a82-b0996a9a5af1-RaUQJvECHitCYczPSvLbDrjjLBE8jN/0@public.gmane.org>
2010-10-15 23:58 ` Grant Likely
[not found] ` <AANLkTinzf3vhs_OUUeiVYOFbOPLFHA+dei810H2gyDGS-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-16 7:10 ` David Gibson
2010-10-15 20:35 ` John Bonesio
2010-10-15 21:25 ` John Bonesio
2010-10-15 23:51 ` Grant Likely
2010-10-16 7:05 ` David Gibson
2010-10-14 0:38 ` Proposal: new device-tree syntax and semantics for extending information " David Gibson
2010-10-14 1:40 ` Grant Likely
[not found] ` <20101014014036.GE15286-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-10-14 1:49 ` Grant Likely
2010-10-14 3:08 ` John Bonesio
2010-10-14 3:37 ` Grant Likely
2010-10-14 4:00 ` David Gibson [this message]
2010-10-14 3:48 ` David Gibson
2010-10-14 4:54 ` Grant Likely
[not found] ` <20101014045413.GK15286-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-10-16 7:02 ` David Gibson
2010-10-16 18:57 ` Grant Likely
[not found] ` <AANLkTi=QaV5KvhFzyci2yykmsV9+Zz71vmoRrrFDGvK--JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-16 19:50 ` John Bonesio
2010-10-17 6:17 ` Grant Likely
2010-10-19 2:48 ` David Gibson
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=20101014040039.GI4456@yookeroo \
--to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
--cc=bones-RkXMcIGFT/TR7s880joybQ@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.