From 55055141c54a6ff43e6337e926ae6c91ab6a701e Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Stelmach?= Date: Wed, 7 Aug 2024 08:34:33 +0200 Subject: [PATCH] scripts: sd_fusing: simplyfy the code structure in get_raw_binary_sector() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Simplify the structure introduced in 098472c46d ("scripts: sd_fusing: Check the raw_binary_table attribute"). Change-Id: Iaf844529d7db2b1df28175689980f0f843e5b86e Signed-off-by: Łukasz Stelmach --- scripts/tizen/sd_fusing.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/tizen/sd_fusing.py b/scripts/tizen/sd_fusing.py index bd9d56e382..72a090e1fd 100755 --- a/scripts/tizen/sd_fusing.py +++ b/scripts/tizen/sd_fusing.py @@ -176,14 +176,14 @@ class SdFusingTarget: return [self.binaries.get(binary, None)] def get_raw_binary_sector(self, binary): - if hasattr(self, "raw_binary_table"): - for entry in self.raw_binary_table: - if entry['binaries'] == binary: - return entry['start_sector']; - return None - else: + if not hasattr(self, "raw_binary_table"): return None + for entry in self.raw_binary_table: + if entry['binaries'] == binary: + return entry['start_sector']; + return None + def ensure_parttable(self): logging.notice(f"Verifying that partition table on {Device} matches target specification") for partnum, part in enumerate(self.part_table, 1): -- 2.34.1