mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 09:12:08 +02:00
binman: Update entry.SetOffsetSize to be optional
At present this function always sets both the offset and the size of entries. But in some cases we want to set only one or the other, for example with the forthcoming ifwi entry, where we only set the offset. Update the function to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -368,13 +368,21 @@ class Entry(object):
|
||||
Dict:
|
||||
key: Entry type
|
||||
value: List containing position and size of the given entry
|
||||
type.
|
||||
type. Either can be None if not known
|
||||
"""
|
||||
return {}
|
||||
|
||||
def SetOffsetSize(self, pos, size):
|
||||
self.offset = pos
|
||||
self.size = size
|
||||
def SetOffsetSize(self, offset, size):
|
||||
"""Set the offset and/or size of an entry
|
||||
|
||||
Args:
|
||||
offset: New offset, or None to leave alone
|
||||
size: New size, or None to leave alone
|
||||
"""
|
||||
if offset is not None:
|
||||
self.offset = offset
|
||||
if size is not None:
|
||||
self.size = size
|
||||
|
||||
def SetImagePos(self, image_pos):
|
||||
"""Set the position in the image
|
||||
|
Reference in New Issue
Block a user