From: Scott Wood <scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: Re: [RFC] dtc: Optionally sort nodes and properties
Date: Wed, 8 Sep 2010 15:39:52 -0500 [thread overview]
Message-ID: <20100908153952.43fbc856@schlenkerla.am.freescale.net> (raw)
In-Reply-To: <20100908202530.GH7065-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
On Wed, 8 Sep 2010 14:25:30 -0600
Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote:
> On Wed, Sep 01, 2010 at 12:47:18PM +1000, David Gibson wrote:
> > Hi folks,
> >
> > Here's a patch I made for dtc a little while ago, and I'm not sure if
> > it's something that sensibly ought to be merged into mainline dtc.
> >
> > The patch adds a '-s' option to dtc, which causes it to "sort" the
> > tree before output. That is, it sorts the reserve entries, it sorts
> > the properties within each node by name, and it sorts nodes by name
> > within their parent.
> >
> > The main use for this is when looking at the differences between two
> > device trees which are similar, except for semantically null internal
> > rearrangements. Directly diffing the dts files will give a lot of
> > noise due to the order changes, but running both trees through dtc -s
> > then diffing will usually give a pretty sensible summary of the
> > changes (it can still be confused by node name changes, of course).
>
> As discussed on IRC, I'm not thrilled with adding this as a
> user-visible option because sorted trees aren't actually useful or
> desirable (and in some cases undesireable) except for the use-case of
> comparing trees. However, being able to compare unsorted trees is
> still a use case that is very much needed, so I'm okay with this patch
> until we come up with something better.
>
> Although maybe the -s option should remain undocumented; or at least
> warn people away from using it.
If it's undocumented, how would people find out how to compare device
trees?
Maybe just add a "(for comparing trees)" note in the help text to
clarify the intended purpose?
-Scott
next prev parent reply other threads:[~2010-09-08 20:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-01 2:47 [RFC] dtc: Optionally sort nodes and properties David Gibson
2010-09-08 20:25 ` Grant Likely
[not found] ` <20100908202530.GH7065-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-09-08 20:39 ` Scott Wood [this message]
[not found] ` <20100908153952.43fbc856-1MYqz8GpK7RekFaExTCHk1jVikpgYyvb5NbjCUgZEJk@public.gmane.org>
2010-09-09 4:49 ` Grant Likely
2010-09-09 18:44 ` Timur Tabi
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=20100908153952.43fbc856@schlenkerla.am.freescale.net \
--to=scottwood-kzfg59tc24xl57midrcfdg@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox