]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
binman: Use super() instead of specifying parent type
authorSimon Glass <sjg@chromium.org>
Fri, 10 Jul 2020 00:39:35 +0000 (18:39 -0600)
committerSimon Glass <sjg@chromium.org>
Mon, 20 Jul 2020 17:37:47 +0000 (11:37 -0600)
It is easier and less error-prone to use super() when the parent type is
needed. Update binman to remove the type names.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
57 files changed:
tools/binman/etype/_testing.py
tools/binman/etype/blob.py
tools/binman/etype/blob_dtb.py
tools/binman/etype/blob_named_by_arg.py
tools/binman/etype/cbfs.py
tools/binman/etype/cros_ec_rw.py
tools/binman/etype/fdtmap.py
tools/binman/etype/files.py
tools/binman/etype/fill.py
tools/binman/etype/fmap.py
tools/binman/etype/gbb.py
tools/binman/etype/image_header.py
tools/binman/etype/intel_cmc.py
tools/binman/etype/intel_descriptor.py
tools/binman/etype/intel_fit.py
tools/binman/etype/intel_fit_ptr.py
tools/binman/etype/intel_fsp.py
tools/binman/etype/intel_fsp_m.py
tools/binman/etype/intel_fsp_s.py
tools/binman/etype/intel_fsp_t.py
tools/binman/etype/intel_ifwi.py
tools/binman/etype/intel_me.py
tools/binman/etype/intel_mrc.py
tools/binman/etype/intel_refcode.py
tools/binman/etype/intel_vbt.py
tools/binman/etype/intel_vga.py
tools/binman/etype/mkimage.py
tools/binman/etype/powerpc_mpc85xx_bootpg_resetvec.py
tools/binman/etype/section.py
tools/binman/etype/text.py
tools/binman/etype/u_boot.py
tools/binman/etype/u_boot_dtb.py
tools/binman/etype/u_boot_dtb_with_ucode.py
tools/binman/etype/u_boot_elf.py
tools/binman/etype/u_boot_img.py
tools/binman/etype/u_boot_nodtb.py
tools/binman/etype/u_boot_spl.py
tools/binman/etype/u_boot_spl_bss_pad.py
tools/binman/etype/u_boot_spl_dtb.py
tools/binman/etype/u_boot_spl_elf.py
tools/binman/etype/u_boot_spl_nodtb.py
tools/binman/etype/u_boot_spl_with_ucode_ptr.py
tools/binman/etype/u_boot_tpl.py
tools/binman/etype/u_boot_tpl_dtb.py
tools/binman/etype/u_boot_tpl_dtb_with_ucode.py
tools/binman/etype/u_boot_tpl_elf.py
tools/binman/etype/u_boot_tpl_with_ucode_ptr.py
tools/binman/etype/u_boot_ucode.py
tools/binman/etype/u_boot_with_ucode_ptr.py
tools/binman/etype/vblock.py
tools/binman/etype/x86_reset16.py
tools/binman/etype/x86_reset16_spl.py
tools/binman/etype/x86_reset16_tpl.py
tools/binman/etype/x86_start16.py
tools/binman/etype/x86_start16_spl.py
tools/binman/etype/x86_start16_tpl.py
tools/binman/image.py

index ea60561adba1e7fdd5630fa6f4b261abc928354e..0800c25899a5336cfe5773704b7429cb48d21c7e 100644 (file)
@@ -41,10 +41,10 @@ class Entry__testing(Entry):
             data type (generating an error)
     """
     def __init__(self, section, etype, node):
-        Entry.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def ReadNode(self):
-        Entry.ReadNode(self)
+        super().ReadNode()
         self.return_invalid_entry = fdt_util.GetBool(self._node,
                                                      'return-invalid-entry')
         self.return_unknown_contents = fdt_util.GetBool(self._node,
index ede7a7a68cf6c72aa134c82f9653ab8abf1bf3ff..e507203709fc8191a9b6a596bf99da2b4a09ec5e 100644 (file)
@@ -31,7 +31,7 @@ class Entry_blob(Entry):
     data.
     """
     def __init__(self, section, etype, node):
-        Entry.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self._filename = fdt_util.GetString(self._node, 'filename', self.etype)
         self.compress = fdt_util.GetString(self._node, 'compress', 'none')
 
index 6c069437633e09137d60c12c6d068d308ba4cd62..724647a7bbbec5c43e9ad387068254fb902122e7 100644 (file)
@@ -20,13 +20,13 @@ class Entry_blob_dtb(Entry_blob):
         global state
         from binman import state
 
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def ObtainContents(self):
         """Get the device-tree from the list held by the 'state' module"""
         self._filename = self.GetDefaultFilename()
         self._pathname, _ = state.GetFdtContents(self.GetFdtEtype())
-        return Entry_blob.ReadBlobContents(self)
+        return super().ReadBlobContents()
 
     def ProcessContents(self):
         """Re-read the DTB contents so that we get any calculated properties"""
@@ -57,7 +57,7 @@ class Entry_blob_dtb(Entry_blob):
         return {self.GetFdtEtype(): [self, fname]}
 
     def WriteData(self, data, decomp=True):
-        ok = Entry_blob.WriteData(self, data, decomp)
+        ok = super().WriteData(data, decomp)
 
         # Update the state module, since it has the authoritative record of the
         # device trees used. If we don't do this, then state.GetFdtContents()
index 3b4593f071a74c19910e0b7ca153db6ebcae8f1f..e95dabe4d07a038cb8255497d1cd8f428244728a 100644 (file)
@@ -29,6 +29,6 @@ class Entry_blob_named_by_arg(Entry_blob):
     See cros_ec_rw for an example of this.
     """
     def __init__(self, section, etype, node, blob_fname):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self._filename, = self.GetEntryArgsOrProps(
             [EntryArg('%s-path' % blob_fname, str)])
index 744a32fa0c231bbccf19861e5e25fda6f9d7e3c6..650ab2c292fa571a1208000bc7f5c6063465c9b8 100644 (file)
@@ -167,7 +167,7 @@ class Entry_cbfs(Entry):
         global state
         from binman import state
 
-        Entry.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self._cbfs_arg = fdt_util.GetString(node, 'cbfs-arch', 'x86')
         self._cbfs_entries = OrderedDict()
         self._ReadSubnodes()
@@ -226,7 +226,7 @@ class Entry_cbfs(Entry):
         Args:
             image_pos: Position of this entry in the image
         """
-        Entry.SetImagePos(self, image_pos)
+        super().SetImagePos(image_pos)
 
         # Now update the entries with info from the CBFS entries
         for entry in self._cbfs_entries.values():
@@ -238,7 +238,7 @@ class Entry_cbfs(Entry):
                 entry.uncomp_size = cfile.memlen
 
     def AddMissingProperties(self):
-        Entry.AddMissingProperties(self)
+        super().AddMissingProperties()
         for entry in self._cbfs_entries.values():
             entry.AddMissingProperties()
             if entry._cbfs_compress:
@@ -250,7 +250,7 @@ class Entry_cbfs(Entry):
 
     def SetCalculatedProperties(self):
         """Set the value of device-tree properties calculated by binman"""
-        Entry.SetCalculatedProperties(self)
+        super().SetCalculatedProperties()
         for entry in self._cbfs_entries.values():
             state.SetInt(entry._node, 'offset', entry.offset)
             state.SetInt(entry._node, 'size', entry.size)
@@ -260,7 +260,7 @@ class Entry_cbfs(Entry):
 
     def ListEntries(self, entries, indent):
         """Override this method to list all files in the section"""
-        Entry.ListEntries(self, entries, indent)
+        super().ListEntries(entries, indent)
         for entry in self._cbfs_entries.values():
             entry.ListEntries(entries, indent + 1)
 
@@ -268,12 +268,12 @@ class Entry_cbfs(Entry):
         return self._cbfs_entries
 
     def ReadData(self, decomp=True):
-        data = Entry.ReadData(self, True)
+        data = super().ReadData(True)
         return data
 
     def ReadChildData(self, child, decomp=True):
         if not self.reader:
-            data = Entry.ReadData(self, True)
+            data = super().ReadData(True)
             self.reader = cbfs_util.CbfsReader(data)
         reader = self.reader
         cfile = reader.files.get(child.name)
index 0dbe14b342a97de22bc10c279b817aec64b919f2..7ad62d026559e2e223cde625adc1608f10f03d5e 100644 (file)
@@ -18,5 +18,4 @@ class Entry_cros_ec_rw(Entry_blob_named_by_arg):
     updating the EC on startup via software sync.
     """
     def __init__(self, section, etype, node):
-        Entry_blob_named_by_arg.__init__(self, section, etype, node,
-                                         'cros-ec-rw')
+        super().__init__(section, etype, node, 'cros-ec-rw')
index aa8807990b7237b16f39e6cb00dac67d7e38f7f9..6ca88a100e5d30b1bfe8dfb0f85df8b60154fa19 100644 (file)
@@ -85,7 +85,7 @@ class Entry_fdtmap(Entry):
         from binman import state
         from dtoc.fdt import Fdt
 
-        Entry.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def _GetFdtmap(self):
         """Build an FDT map from the entries in the current image
index 10ab585f0ed391352413df57fe3b81e9c8c89b06..9adb3afeb147c250fdec1abb76e2a1947279bfea 100644 (file)
@@ -32,7 +32,7 @@ class Entry_files(Entry_section):
         global state
         from binman import state
 
-        Entry_section.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self._pattern = fdt_util.GetString(self._node, 'pattern')
         if not self._pattern:
             self.Raise("Missing 'pattern' property")
index 860410ed6e52af627934d4a16e5e95770a4b0e5d..efb2d13e910d20387dcb523a827ce0881dedc301 100644 (file)
@@ -22,10 +22,10 @@ class Entry_fill(Entry):
     byte value of a region.
     """
     def __init__(self, section, etype, node):
-        Entry.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def ReadNode(self):
-        Entry.ReadNode(self)
+        super().ReadNode()
         if self.size is None:
             self.Raise("'fill' entry must have a size property")
         self.fill_value = fdt_util.GetByte(self._node, 'fill-byte', 0)
index a43fac38de2ff827404d0097c13a5ce7a8fed734..3e9b815d119946099e613703aef068861f1693a8 100644 (file)
@@ -32,7 +32,7 @@ class Entry_fmap(Entry):
     the sub-entries are ignored.
     """
     def __init__(self, section, etype, node):
-        Entry.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def _GetFmap(self):
         """Build an FMAP from the entries in the current image
index dd1059971791fe1a6873acdafda1b0b31f811b84..41554eba8f68b0432215a8249f754fb97b39ac8a 100644 (file)
@@ -54,7 +54,7 @@ class Entry_gbb(Entry):
     README.chromium for how to obtain the required keys and tools.
     """
     def __init__(self, section, etype, node):
-        Entry.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self.hardware_id, self.keydir, self.bmpblk = self.GetEntryArgsOrProps(
             [EntryArg('hardware-id', str),
              EntryArg('keydir', str),
index 176bdeb29b3341933010debb81dd4b565664d537..240118849580c66107824d746609608f89d473bf 100644 (file)
@@ -57,7 +57,7 @@ class Entry_image_header(Entry):
     first/last in the entry list.
     """
     def __init__(self, section, etype, node):
-        Entry.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self.location = fdt_util.GetString(self._node, 'location')
 
     def _GetHeader(self):
@@ -101,7 +101,7 @@ class Entry_image_header(Entry):
                 else:
                     offset = image_size - IMAGE_HEADER_LEN
         offset += self.section.GetStartOffset()
-        return Entry.Pack(self, offset)
+        return super().Pack(offset)
 
     def ProcessContents(self):
         """Write an updated version of the FDT map to this entry
index 5e6edbe4dfd748d6e86a41316c36799b8b643798..9ab471e7b6fbd4b7c90b7270a24cd53b0c2edd14 100644 (file)
@@ -20,4 +20,4 @@ class Entry_intel_cmc(Entry_blob):
     See README.x86 for information about x86 binary blobs.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
index d4d7a26901d066acea825cda3241be36fb81508d..6afc42ece54019a9581034540a1408cc34d31163 100644 (file)
@@ -45,14 +45,14 @@ class Entry_intel_descriptor(Entry_blob):
     See README.x86 for information about x86 binary blobs.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self._regions = []
 
     def Pack(self, offset):
         """Put this entry at the start of the image"""
         if self.offset is None:
             offset = self.section.GetStartOffset()
-        return Entry_blob.Pack(self, offset)
+        return super().Pack(offset)
 
     def GetOffsets(self):
         offset = self.data.find(FD_SIGNATURE)
index ea482a61254480f5b9d1f720a26c8415c42c0db5..ad6c1caa856f4a58895f84a28a2a7c89741dfc23 100644 (file)
@@ -19,11 +19,11 @@ class Entry_intel_fit(Entry_blob):
     At present binman only supports a basic FIT with no microcode.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def ReadNode(self):
         """Force 16-byte alignment as required by FIT pointer"""
-        Entry_blob.ReadNode(self)
+        super().ReadNode()
         self.align = 16
 
     def ObtainContents(self):
index df118a68f2d5a31f5ad846f58119ae801cc9e955..a06d12e740bcb9d5866f32fe773fff7811bc0181 100644 (file)
@@ -16,7 +16,7 @@ class Entry_intel_fit_ptr(Entry_blob):
     0xffffffc0 in the image.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         if self.HasSibling('intel-fit') is False:
             self.Raise("'intel-fit-ptr' section must have an 'intel-fit' sibling")
 
@@ -38,4 +38,4 @@ class Entry_intel_fit_ptr(Entry_blob):
 
     def Pack(self, offset):
         """Special pack method to set the offset to the right place"""
-        return Entry_blob.Pack(self, 0xffffffc0)
+        return super().Pack(0xffffffc0)
index 7db3d96b432bb62e65edb942b158ee1b16ebd0dd..a1c89adcea62177e54934f10a03fa40d18053975 100644 (file)
@@ -24,4 +24,4 @@ class Entry_intel_fsp(Entry_blob):
     See README.x86 for information about x86 binary blobs.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
index 51b4e7e1ac31583d2f861af0d11e8469ddc5431e..4c225b24d3699d6151a471e32262213076ac475c 100644 (file)
@@ -24,4 +24,4 @@ class Entry_intel_fsp_m(Entry_blob):
     See README.x86 for information about x86 binary blobs.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
index b3683e476a0e6aac490338b68108223654e35323..9e1107182a393b2821f9d31dfe6ba882112cc04a 100644 (file)
@@ -24,4 +24,4 @@ class Entry_intel_fsp_s(Entry_blob):
     See README.x86 for information about x86 binary blobs.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
index 0f196f0f1c12a26dfb4d2282c72eacdb1a0b8713..5dca145a3f4ae656d7a02a6091fc26447df03a47 100644 (file)
@@ -23,4 +23,4 @@ class Entry_intel_fsp_t(Entry_blob):
     See README.x86 for information about x86 binary blobs.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
index 6a96f6be552cd6680f7b478559036dcf084cbf3f..ba63f6574f93279592d2686e78ee4163ce1dc44c 100644 (file)
@@ -45,13 +45,13 @@ class Entry_intel_ifwi(Entry_blob):
     See README.x86 for information about x86 binary blobs.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self._convert_fit = fdt_util.GetBool(self._node, 'convert-fit')
         self._ifwi_entries = OrderedDict()
 
     def ReadNode(self):
         self._ReadSubnodes()
-        Entry_blob.ReadNode(self)
+        super().ReadNode()
 
     def _BuildIfwi(self):
         """Build the contents of the IFWI and write it to the 'data' property"""
index 2707ca6912bd8de00e29dbf733db4227968f6bf7..6b3803819ecb1f1f0d930b4bc271ba46c55e682c 100644 (file)
@@ -27,4 +27,4 @@ class Entry_intel_me(Entry_blob):
     See README.x86 for information about x86 binary blobs.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
index 854a4dda61590b1f454f851061eec72c13d31bf9..74781848e27f9531a70e0798a61a15c44d16b10c 100644 (file)
@@ -21,7 +21,7 @@ class Entry_intel_mrc(Entry_blob):
     See README.x86 for information about x86 binary blobs.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'mrc.bin'
index a1059f787e6ed96818a881a06ec987ef9fde9332..5754fec4f8f1e26fc0cb7751706e520c11609fd9 100644 (file)
@@ -21,7 +21,7 @@ class Entry_intel_refcode(Entry_blob):
     See README.x86 for information about x86 binary blobs.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'refcode.bin'
index 4d465ad01732547ebcf6f9b87107d9fa399aaa6c..f6d7b466ea2c6d15aa2a53dba845007f075d5bf2 100644 (file)
@@ -19,4 +19,4 @@ class Entry_intel_vbt(Entry_blob):
     See README.x86 for information about Intel binary blobs.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
index 04cd72f3dc19089059ee563bc36a2f5a2d289f44..6b87c01b4cec96442d47d7da888f44654558ef80 100644 (file)
@@ -22,4 +22,4 @@ class Entry_intel_vga(Entry_blob):
     See README.x86 for information about Intel binary blobs.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
index 1aa563963a64a6019d0f073aa1891f7dc5918934..8fddc88118775817810544906e42cfaad572ccef 100644 (file)
@@ -33,7 +33,7 @@ class Entry_mkimage(Entry):
     binman.
     """
     def __init__(self, section, etype, node):
-        Entry.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self._args = fdt_util.GetString(self._node, 'args').split(' ')
         self._mkimage_entries = OrderedDict()
         self._ReadSubnodes()
index 28005c60b3a58c8a56a43f9950ae5dc8b1e87d32..b0fa75fbf884bd84a7b08db2b852c929c64ffbee 100644 (file)
@@ -19,7 +19,7 @@ class Entry_powerpc_mpc85xx_bootpg_resetvec(Entry_blob):
     """
 
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'u-boot-br.bin'
index 91b8e0c1100716f5a33476ca3202655279e3ab41..f108121c3a2eee0192e82bf3092270590d5b6ca9 100644 (file)
@@ -43,7 +43,7 @@ class Entry_section(Entry):
     """
     def __init__(self, section, etype, node, test=False):
         if not test:
-            Entry.__init__(self, section, etype, node)
+            super().__init__(section, etype, node)
         self._entries = OrderedDict()
         self._pad_byte = 0
         self._sort = False
@@ -52,7 +52,7 @@ class Entry_section(Entry):
 
     def ReadNode(self):
         """Read properties from the image node"""
-        Entry.ReadNode(self)
+        super().ReadNode()
         self._pad_byte = fdt_util.GetInt(self._node, 'pad-byte', 0)
         self._sort = fdt_util.GetBool(self._node, 'sort-by-offset')
         self._end_4gb = fdt_util.GetBool(self._node, 'end-at-4gb')
@@ -126,13 +126,13 @@ class Entry_section(Entry):
         a section containing a list of files. Process these entries so that
         this information is added to the device tree.
         """
-        Entry.ExpandEntries(self)
+        super().ExpandEntries()
         for entry in self._entries.values():
             entry.ExpandEntries()
 
     def AddMissingProperties(self):
         """Add new properties to the device tree as needed for this entry"""
-        Entry.AddMissingProperties(self)
+        super().AddMissingProperties()
         for entry in self._entries.values():
             entry.AddMissingProperties()
 
@@ -168,14 +168,14 @@ class Entry_section(Entry):
 
     def ResetForPack(self):
         """Reset offset/size fields so that packing can be done again"""
-        Entry.ResetForPack(self)
+        super().ResetForPack()
         for entry in self._entries.values():
             entry.ResetForPack()
 
     def Pack(self, offset):
         """Pack all entries into the section"""
         self._PackEntries()
-        return Entry.Pack(self, offset)
+        return super().Pack(offset)
 
     def _PackEntries(self):
         """Pack all entries into the image"""
@@ -232,12 +232,12 @@ class Entry_section(Entry):
             entry.WriteSymbols(self)
 
     def SetCalculatedProperties(self):
-        Entry.SetCalculatedProperties(self)
+        super().SetCalculatedProperties()
         for entry in self._entries.values():
             entry.SetCalculatedProperties()
 
     def SetImagePos(self, image_pos):
-        Entry.SetImagePos(self, image_pos)
+        super().SetImagePos(image_pos)
         for entry in self._entries.values():
             entry.SetImagePos(image_pos + self.offset)
 
index 3577135adbe39ab17fc50df0a2d5c9bed1cbcdde..a69c2a4ec48a4f72237729ea360a1e7a3fad18dd 100644 (file)
@@ -57,7 +57,7 @@ class Entry_text(Entry):
     by setting the size of the entry to something larger than the text.
     """
     def __init__(self, section, etype, node):
-        Entry.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         value = fdt_util.GetString(self._node, 'text')
         if value:
             value = tools.ToBytes(value)
index ab1019b00c7b082b486dd1a67321204f954a5261..4767197e13a82df17e47fdbad26fe735cf7920e3 100644 (file)
@@ -26,7 +26,7 @@ class Entry_u_boot(Entry_blob):
     in the binman README for more information.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'u-boot.bin'
index e98350088f5c1053f3c65bcbe10038692e83e6bb..65e71291d27d0596bf9f73358c3f7e7b3a9abbd3 100644 (file)
@@ -22,7 +22,7 @@ class Entry_u_boot_dtb(Entry_blob_dtb):
     binman to know which entries contain a device tree.
     """
     def __init__(self, section, etype, node):
-        Entry_blob_dtb.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'u-boot.dtb'
index aec145533eb5a0045d9091dacc1b229e04bc71be..66a9db55cadfe4573e3fc80600832bd4b918f897 100644 (file)
@@ -28,7 +28,7 @@ class Entry_u_boot_dtb_with_ucode(Entry_blob_dtb):
         global state
         from binman import state
 
-        Entry_blob_dtb.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self.ucode_data = b''
         self.collate = False
         self.ucode_offset = None
@@ -78,7 +78,7 @@ class Entry_u_boot_dtb_with_ucode(Entry_blob_dtb):
 
     def ObtainContents(self):
         # Call the base class just in case it does something important.
-        Entry_blob_dtb.ObtainContents(self)
+        super().ObtainContents()
         if self.ucode and not self.collate:
             for node in self.ucode.subnodes:
                 data_prop = node.props.get('data')
index 5f906e520cf076b18475775cc1fb22d699451833..6614a75fafa93eca5d66306720e19fd4812e5d7d 100644 (file)
@@ -21,7 +21,7 @@ class Entry_u_boot_elf(Entry_blob):
     relocated to any address for execution.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self._strip = fdt_util.GetBool(self._node, 'strip')
 
     def ReadBlobContents(self):
@@ -31,7 +31,7 @@ class Entry_u_boot_elf(Entry_blob):
             tools.WriteFile(out_fname, tools.ReadFile(self._pathname))
             tools.Run('strip', out_fname)
             self._pathname = out_fname
-        Entry_blob.ReadBlobContents(self)
+        super().ReadBlobContents()
         return True
 
     def GetDefaultFilename(self):
index 50cc71d3ce2a33ae670cf53df7c90e1c6ac08832..8a739d8edb60a082f5f8a4c58eef48a2325ca299 100644 (file)
@@ -21,7 +21,7 @@ class Entry_u_boot_img(Entry_blob):
     applications.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'u-boot.img'
index e8c0e1a1d6c45c3fc8f04cab52b3488d1c01e961..e84df490f65b168905f2837d88ca8dcbf2037609 100644 (file)
@@ -21,7 +21,7 @@ class Entry_u_boot_nodtb(Entry_blob):
     U-Boot and the device tree).
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'u-boot-nodtb.bin'
index a6fddbe8f14b50d788c059951afb338f93b5a3a2..d66e46140be8f14497bb8d30240e4aa822b2185d 100644 (file)
@@ -32,7 +32,7 @@ class Entry_u_boot_spl(Entry_blob):
     binman uses that to look up symbols to write into the SPL binary.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self.elf_fname = 'spl/u-boot-spl'
 
     def GetDefaultFilename(self):
index a6a177a1287747b3344a696bf312d2bb21c78312..596b2bed97eff7bb564ea16c0af186d2f63d9d45 100644 (file)
@@ -31,7 +31,7 @@ class Entry_u_boot_spl_bss_pad(Entry_blob):
     binman uses that to look up the BSS address.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def ObtainContents(self):
         fname = tools.GetInputFilename('spl/u-boot-spl')
index a0761eeacd6663f983778455c90af142b864e63c..eefc4a44aabbc6ac86df33d1ea8bbb9f48149432 100644 (file)
@@ -19,7 +19,7 @@ class Entry_u_boot_spl_dtb(Entry_blob_dtb):
     to activate.
     """
     def __init__(self, section, etype, node):
-        Entry_blob_dtb.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'spl/u-boot-spl.dtb'
index f99f74abab230c6ccb18d803eb644c378a4e47cf..7f1236bcbb397088aaff5f76521f8cbc6c09a22b 100644 (file)
@@ -18,7 +18,7 @@ class Entry_u_boot_spl_elf(Entry_blob):
     be relocated to any address for execution.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'spl/u-boot-spl'
index 072b915ff3a24395a6efe5a5012c0217334bdc21..6f4529396d8aae457e8ad90203b8248e1e9d5707 100644 (file)
@@ -22,7 +22,7 @@ class Entry_u_boot_spl_nodtb(Entry_blob):
     both SPL and the device tree).
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'spl/u-boot-spl-nodtb.bin'
index b1543a5ef323e09833c6dff0b91bb2cca5e5a3fe..72739a5eb67b07d9531d15aad70a8cfda6f0bf77 100644 (file)
@@ -18,7 +18,7 @@ class Entry_u_boot_spl_with_ucode_ptr(Entry_u_boot_with_ucode_ptr):
     process.
     """
     def __init__(self, section, etype, node):
-        Entry_u_boot_with_ucode_ptr.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self.elf_fname = 'spl/u-boot-spl'
 
     def GetDefaultFilename(self):
index 6562457c9a673c8ab5226d6bc354ad6532dcad46..02287ab32755bb380d95e2d939b56de1c098a7e8 100644 (file)
@@ -32,7 +32,7 @@ class Entry_u_boot_tpl(Entry_blob):
     binman uses that to look up symbols to write into the TPL binary.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self.elf_fname = 'tpl/u-boot-tpl'
 
     def GetDefaultFilename(self):
index 890155f271f3d466430ab381b14da579e29e977b..2ff1d7ced1a26f128dfa5b98c6c8f94c5573e181 100644 (file)
@@ -19,7 +19,7 @@ class Entry_u_boot_tpl_dtb(Entry_blob_dtb):
     to activate.
     """
     def __init__(self, section, etype, node):
-        Entry_blob_dtb.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'tpl/u-boot-tpl.dtb'
index ca1bf85ace7b33236c45faeeb51e76c4914f324c..066f18dfef28f2fd039293477dd14fc9f5a15e68 100644 (file)
@@ -16,7 +16,7 @@ class Entry_u_boot_tpl_dtb_with_ucode(Entry_u_boot_dtb_with_ucode):
     process.
     """
     def __init__(self, section, etype, node):
-        Entry_u_boot_dtb_with_ucode.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'tpl/u-boot-tpl.dtb'
index 7fa8e963640fe38f481c821b472216a2d5405800..3f24d3aa7bc8f6f0cad511259d6de14074f05121 100644 (file)
@@ -18,7 +18,7 @@ class Entry_u_boot_tpl_elf(Entry_blob):
     be relocated to any address for execution.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'tpl/u-boot-tpl'
index 7f7fab71051c07741ceb127808fa0dd6a58959d7..c7f3f9dedb59a81bf262307873c4e11dfa922b13 100644 (file)
@@ -20,7 +20,7 @@ class Entry_u_boot_tpl_with_ucode_ptr(Entry_u_boot_with_ucode_ptr):
     process.
     """
     def __init__(self, section, etype, node):
-        Entry_u_boot_with_ucode_ptr.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self.elf_fname = 'tpl/u-boot-tpl'
 
     def GetDefaultFilename(self):
index d9e1a605efa48a081e6b44f9b7708efd78d90a05..4462293618239fc9a290bdf3d91672027177c26a 100644 (file)
@@ -58,7 +58,7 @@ class Entry_u_boot_ucode(Entry_blob):
             contents of this entry.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def ObtainContents(self):
         # If the section does not need microcode, there is nothing to do
index 06047b654df577e0a96259ca6e16679f7bd98425..92d2fc68538dba13b92469f00c2eb5df5f59f9dc 100644 (file)
@@ -29,7 +29,7 @@ class Entry_u_boot_with_ucode_ptr(Entry_blob):
     complicated. Otherwise it is the same as the u_boot entry.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self.elf_fname = 'u-boot'
         self.target_offset = None
 
index 5753de7ec7aa17070c6594b0bf3388a850ee7b48..f734fbaec495c690cc5c710ec787a89c6c6ac0c4 100644 (file)
@@ -36,7 +36,7 @@ class Entry_vblock(Entry):
     and kernel are genuine.
     """
     def __init__(self, section, etype, node):
-        Entry.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
         self.content = fdt_util.GetPhandleList(self._node, 'content')
         if not self.content:
             self.Raise("Vblock must have a 'content' property")
index ad864e54429b5411d572bb8413d12664b6cd2d19..5d49f16e21cfa652cb700bc00c848f713802feac 100644 (file)
@@ -23,7 +23,7 @@ class Entry_x86_reset16(Entry_blob):
     For 64-bit U-Boot, the 'x86_reset16_spl' entry type is used instead.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'u-boot-x86-reset16.bin'
index 9a663f0ae231f302cb2dd084fdc39c5fa5dc24ac..775b90699baf7db166ec03b72233eb06022bf5ee 100644 (file)
@@ -23,7 +23,7 @@ class Entry_x86_reset16_spl(Entry_blob):
     For 32-bit U-Boot, the 'x86_reset_spl' entry type is used instead.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'spl/u-boot-x86-reset16-spl.bin'
index 864508f367261ed6b36ff0d0719d216ec6cd3942..52d3f4869ae27c019fff2a04679e78cbdccf7d7c 100644 (file)
@@ -23,7 +23,7 @@ class Entry_x86_reset16_tpl(Entry_blob):
     For 32-bit U-Boot, the 'x86_reset_tpl' entry type is used instead.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'tpl/u-boot-x86-reset16-tpl.bin'
index d8345f67221f4b1e4f1eb9696cf39c047c174c1a..18fdd95d3707721a42860064c32931595de0a08a 100644 (file)
@@ -25,7 +25,7 @@ class Entry_x86_start16(Entry_blob):
     For 64-bit U-Boot, the 'x86_start16_spl' entry type is used instead.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'u-boot-x86-start16.bin'
index ad520d3c6d905619c5ce7b99464127a8c0cba509..ac8e90f2e0c6060e1703ae6700f778c186f8b800 100644 (file)
@@ -25,7 +25,7 @@ class Entry_x86_start16_spl(Entry_blob):
     For 32-bit U-Boot, the 'x86-start16' entry type is used instead.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'spl/u-boot-x86-start16-spl.bin'
index ccc8727d1d45160a57c9990cd476cd1d92ad4224..72d4608bb73f1789bbc250d0ef49f7960e6b447e 100644 (file)
@@ -26,7 +26,7 @@ class Entry_x86_start16_tpl(Entry_blob):
     may be used instead.
     """
     def __init__(self, section, etype, node):
-        Entry_blob.__init__(self, section, etype, node)
+        super().__init__(section, etype, node)
 
     def GetDefaultFilename(self):
         return 'tpl/u-boot-x86-start16-tpl.bin'
index 523b274c3192c555e599da80b44e6c2b04e3b3c1..a8772c3763b372e79f6c606191e5f798dbf36ee7 100644 (file)
@@ -45,7 +45,7 @@ class Image(section.Entry_section):
             we create a section manually.
     """
     def __init__(self, name, node, copy_to_orig=True, test=False):
-        section.Entry_section.__init__(self, None, 'section', node, test=test)
+        super().__init__(None, 'section', node, test=test)
         self.copy_to_orig = copy_to_orig
         self.name = 'main-section'
         self.image_name = name
@@ -57,7 +57,7 @@ class Image(section.Entry_section):
             self.ReadNode()
 
     def ReadNode(self):
-        section.Entry_section.ReadNode(self)
+        super().ReadNode()
         filename = fdt_util.GetString(self._node, 'filename')
         if filename:
             self._filename = filename
@@ -116,11 +116,11 @@ class Image(section.Entry_section):
 
     def PackEntries(self):
         """Pack all entries into the image"""
-        section.Entry_section.Pack(self, 0)
+        super().Pack(0)
 
     def SetImagePos(self):
         # This first section in the image so it starts at 0
-        section.Entry_section.SetImagePos(self, 0)
+        super().SetImagePos(0)
 
     def ProcessEntryContents(self):
         """Call the ProcessContents() method for each entry
@@ -139,7 +139,7 @@ class Image(section.Entry_section):
 
     def WriteSymbols(self):
         """Write symbol values into binary files for access at run time"""
-        section.Entry_section.WriteSymbols(self, self)
+        super().WriteSymbols(self)
 
     def BuildImage(self):
         """Write the image to a file"""
@@ -161,7 +161,7 @@ class Image(section.Entry_section):
         with open(fname, 'w') as fd:
             print('%8s  %8s  %8s  %s' % ('ImagePos', 'Offset', 'Size', 'Name'),
                   file=fd)
-            section.Entry_section.WriteMap(self, fd, 0)
+            super().WriteMap(fd, 0)
         return fname
 
     def BuildEntryList(self):