[PATCH 1/1] Improve device tree directory sorting
Simon Horman
horms at verge.net.au
Wed Nov 25 18:16:14 PST 2015
On Tue, Nov 24, 2015 at 06:17:10PM -0800, Curt Brune wrote:
> Previously when sorting the device tree directory entries, if both
> device tree entries contained the '@' character then comparison was
> made based on the length of the strings.
>
> This did not work in all cases and could result in odd orderings.
>
> This patch modifies the comparison function for the case when both
> strings contain the '@' character.
>
> First a lexical comparison is made between the prefix portions of the
> strings *before* the '@' character.
>
> Next, if the prefixes are equal, the lengths of the suffixes *after*
> the '@' character are compared. This preserves the intent of the
> original code.
>
> Next, if the suffix lengths are equal, a lexical comparison of the
> suffixes is made.
>
> This is still not strictly correct, as ideally the portion after the
> '@' should be compared numerically. However, determining what base to
> use for all case is difficult.
>
> Signed-off-by: Curt Brune <curt at cumulusnetworks.com>
Thanks, applied.
More information about the kexec
mailing list