]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
binman: Call CheckSize() from the section's Pack() method
authorSimon Glass <sjg@chromium.org>
Mon, 26 Oct 2020 23:40:21 +0000 (17:40 -0600)
committerSimon Glass <sjg@chromium.org>
Thu, 29 Oct 2020 20:42:59 +0000 (14:42 -0600)
At present CheckSize() is called from the function that packs the entries.
Move it up to the main Pack() function so that _PackEntries() can just
do the packing.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/binman/etype/section.py

index c883f0d67c4438159290639de476624d1042f547..f93469a170bec3d3f8a6aff04fbdfde4a5b30b61 100644 (file)
@@ -264,6 +264,9 @@ class Entry_section(Entry):
             self._SortEntries()
         self._ExpandEntries()
 
+        size = self.CheckSize()
+        self.size = size
+
         return super().Pack(offset)
 
     def _PackEntries(self):
@@ -271,7 +274,7 @@ class Entry_section(Entry):
         offset = self._skip_at_start
         for entry in self._entries.values():
             offset = entry.Pack(offset)
-        self.size = self.CheckSize()
+        return offset
 
     def _ExpandEntries(self):
         """Expand any entries that are permitted to"""