diff options
author | Curt Brune <curt@cumulusnetworks.com> | 2015-11-24 18:17:10 -0800 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2015-11-26 11:15:35 +0900 |
commit | 0e1030b345b9e7c1c64b85dde32a282a19b825f0 (patch) | |
tree | 8bc66c3a2ed11bc182feeb38326d455adb8c1d88 /kexec/kexec.c | |
parent | 4bad06c3cd2a989459458eadd78c703ac5a3b8b6 (diff) |
Improve device tree directory sorting
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@cumulusnetworks.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/kexec.c')
0 files changed, 0 insertions, 0 deletions