binman: Rename ExpandToLimit to extend_to_limit

The word 'expand' is used for entries which generate subentries. It is
also used for entries that can have an '_expanded' version which is used
to break out its contents.

Rather than talking about expanding an entry's size, use the term
'extending'. It is slightly more precise and avoids the above conflicts.

This change renders the old 'expand-size' property invalid, so add an
error check for that.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
This commit is contained in:
Simon Glass 2022-03-05 20:18:59 -07:00
parent 6d427c4bcb
commit 80a66ae646
10 changed files with 51 additions and 31 deletions

View file

@ -106,7 +106,7 @@ class Entry(object):
self.pad_after = 0
self.offset_unset = False
self.image_pos = None
self.expand_size = False
self.extend_size = False
self.compress = 'none'
self.missing = False
self.faked = False
@ -235,6 +235,8 @@ class Entry(object):
"""
if 'pos' in self._node.props:
self.Raise("Please use 'offset' instead of 'pos'")
if 'expand-size' in self._node.props:
self.Raise("Please use 'extend-size' instead of 'expand-size'")
self.offset = fdt_util.GetInt(self._node, 'offset')
self.size = fdt_util.GetInt(self._node, 'size')
self.orig_offset = fdt_util.GetInt(self._node, 'orig-offset')
@ -262,7 +264,7 @@ class Entry(object):
self.align_size)
self.align_end = fdt_util.GetInt(self._node, 'align-end')
self.offset_unset = fdt_util.GetBool(self._node, 'offset-unset')
self.expand_size = fdt_util.GetBool(self._node, 'expand-size')
self.extend_size = fdt_util.GetBool(self._node, 'extend-size')
self.missing_msg = fdt_util.GetString(self._node, 'missing-msg')
# This is only supported by blobs and sections at present
@ -774,8 +776,8 @@ features to produce new behaviours.
name = '%s.%s' % (node.name, name)
return name
def ExpandToLimit(self, limit):
"""Expand an entry so that it ends at the given offset limit"""
def extend_to_limit(self, limit):
"""Extend an entry so that it ends at the given offset limit"""
if self.offset + self.size < limit:
self.size = limit - self.offset
# Request the contents again, since changing the size requires that