diff options
author | Simon Glass <sjg@chromium.org> | 2020-10-26 17:40:19 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-10-29 14:42:59 -0600 |
commit | c1af7a86b380c75c0718c80e1997293913c6095a (patch) | |
tree | 058e65fc946792f3e913b86edf4e6f7da7ae69c9 /tools/binman | |
parent | 6ddd61131f3206c5e385dc7e763aea0dc5caa24c (diff) | |
download | u-boot-c1af7a86b380c75c0718c80e1997293913c6095a.zip u-boot-c1af7a86b380c75c0718c80e1997293913c6095a.tar.gz u-boot-c1af7a86b380c75c0718c80e1997293913c6095a.tar.bz2 |
binman: Move sort and expand to the main Pack() function
At present sorting and expanding entries are side-effects of the
CheckEntries() function. This is a bit confusing, as 'checking' would
not normally involve making changes.
Move these steps into the Pack() function instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman')
-rw-r--r-- | tools/binman/etype/section.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index fb4bf64..c883f0d 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -260,6 +260,10 @@ class Entry_section(Entry): def Pack(self, offset): """Pack all entries into the section""" self._PackEntries() + if self._sort: + self._SortEntries() + self._ExpandEntries() + return super().Pack(offset) def _PackEntries(self): @@ -290,9 +294,6 @@ class Entry_section(Entry): def CheckEntries(self): """Check that entries do not overlap or extend outside the section""" - if self._sort: - self._SortEntries() - self._ExpandEntries() offset = 0 prev_name = 'None' for entry in self._entries.values(): |