binman: Increase test coverage back to 100%
authorSimon Glass <sjg@chromium.org>
Mon, 13 Nov 2017 04:52:23 +0000 (21:52 -0700)
committerSimon Glass <sjg@chromium.org>
Thu, 23 Nov 2017 01:05:38 +0000 (18:05 -0700)
Make a minor tweak to fix test coverage.

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

index 8e51e99a1190700daf7facd9ed595ca081ea5f93..f9f434d2cc269767e97554e1ded4f948ed26a3dd 100644 (file)
@@ -58,13 +58,10 @@ class Entry_u_boot_ucode(Entry_blob):
     def ObtainContents(self):
         # If the image does not need microcode, there is nothing to do
         ucode_dest_entry = self.image.FindEntryType('u-boot-with-ucode-ptr')
-        if ucode_dest_entry and not ucode_dest_entry.target_pos:
-            self.data = ''
-            return True
-
-        # Handle microcode in SPL image as well
-        ucode_dest_entry = self.image.FindEntryType('u-boot-spl-with-ucode-ptr')
-        if ucode_dest_entry and not ucode_dest_entry.target_pos:
+        ucode_dest_entry_spl = self.image.FindEntryType(
+            'u-boot-spl-with-ucode-ptr')
+        if ((not ucode_dest_entry or not ucode_dest_entry.target_pos) and
+            (not ucode_dest_entry_spl or not ucode_dest_entry_spl.target_pos)):
             self.data = ''
             return True