From: Łukasz Stelmach Date: Wed, 7 Aug 2024 06:34:33 +0000 (+0200) Subject: scripts: sd_fusing: simplyfy the code structure in get_raw_binary_sector() X-Git-Tag: accepted/tizen/unified/20241126.175211~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cdce2fa74c160734e336df176d8d9c912ea90c09;p=platform%2Fkernel%2Fu-boot.git scripts: sd_fusing: simplyfy the code structure in get_raw_binary_sector() Simplify the structure introduced in 098472c46d ("scripts: sd_fusing: Check the raw_binary_table attribute"). Change-Id: Iaf844529d7db2b1df28175689980f0f843e5b86e Signed-off-by: Łukasz Stelmach --- 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):