All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
To: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"jk-mnsaURCQ41sdnm+yROfE0A@public.gmane.org"
	<jk-mnsaURCQ41sdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH] dtc: Sort unit addresses by number
Date: Fri, 24 Jan 2014 23:21:10 +1100	[thread overview]
Message-ID: <20140124232110.51de5adc@kryten> (raw)
In-Reply-To: <20140121100221.GJ28747-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>


Hi Mark,

> Minor issue, but when #address-cells == 2, some unit addresses are
> split in the middle by a ',' to separate the value of each cell, e.g.
> "flash@2,0". For those, is_hex will return false and we'll compare
> unit-addresses as strings.
> 
> I took a quick look over the dts in the Linux kernel tree (with `git
> grep "@.\+," -- arch/*/boot/dts` and I think every instance there
> would sort correctly as a string, but it would be nice to fix the
> issue regardless of how large the unit-address is.
> 
> Perhaps we could have a helper function for reading the unit-address
> that would take this into account?

I was already getting nervous at the complexity of the sort function,
so I added the is_hex() check to ignore any complex unit addresses. 

A helper function to read a unit address sounds like a simple enough
solution though.

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

      parent reply	other threads:[~2014-01-24 12:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-21  2:49 [PATCH] dtc: Sort unit addresses by number Anton Blanchard
2014-01-21 10:02 ` Mark Rutland
     [not found]   ` <20140121100221.GJ28747-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2014-01-24 12:21     ` Anton Blanchard [this message]

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=20140124232110.51de5adc@kryten \
    --to=anton-eunubhrolfbytjvyw6ydsg@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jk-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@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.