From b678246209c531602e0b8296320aebb22392c1b0 Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Mon, 22 Jul 2024 16:37:55 +0900 Subject: [PATCH] tmp --- scripts/build/gen_isr_tables_parser_carrays.py | 10 +++++----- scripts/build/gen_isr_tables_parser_local.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/build/gen_isr_tables_parser_carrays.py b/scripts/build/gen_isr_tables_parser_carrays.py index afaff194446958..84add9d4185b21 100644 --- a/scripts/build/gen_isr_tables_parser_carrays.py +++ b/scripts/build/gen_isr_tables_parser_carrays.py @@ -188,7 +188,7 @@ def __parse_intlist(self, intlist): def __aligned_vt(self): """Returns vt with non-None entries aligned in front. """ - vt = [v for v in self.__vt if not v is None] if self.__vt else [] + vt = [v for v in self.__vt if not v is None] vt.extend([None] * (self.__nv- len(vt))) return vt @@ -196,7 +196,7 @@ def __aligned_swt(self): """Returns swt with non-None entries aligned in front. Empty entries equal to the number of vt entries are inserted at the beginning. """ - swt = [[] for v in self.__vt if not v is None] if self.__swt else [] + swt = [[] for v in self.__vt if not v is None] swt.extend([sw for sw in self.__swt if not sw == []]) swt.extend([[]] * (self.__nv - len(swt))) return swt @@ -285,10 +285,10 @@ def __write_intr_id_table(self, fp): fp.write("};\n") def write_source(self, fp): - vt = [v for v in self.__vt if not v is None] if self.__vt else [] - swt = [sw for sw in self.__swt if not sw == []] if self.__swt else [] + vt_len = len([v for v in self.__vt if not v is None]) if self.__vt else 0 + swt_len = len([sw for sw in self.__swt if not sw == []]) if self.__swt else 0 - if len(vt + swt) > self.__nv: + if (vt_len + swt_len) > self.__nv: self.__log.error("Too many ISRs are defined.") fp.write(self.source_header) diff --git a/scripts/build/gen_isr_tables_parser_local.py b/scripts/build/gen_isr_tables_parser_local.py index d0f7d83f363a08..16ec77ca0f8d97 100644 --- a/scripts/build/gen_isr_tables_parser_local.py +++ b/scripts/build/gen_isr_tables_parser_local.py @@ -267,7 +267,7 @@ def __irq_spurious_entry(self, irq): def __aligned_vt(self): """Returns vt with non-None entries aligned in front. """ - vt = [v for v in self.__vt if not v is None] if self.__vt else [] + vt = [v for v in self.__vt if not v is None] vt.extend([None] * (self.__nv- len(vt))) return vt @@ -275,7 +275,7 @@ def __aligned_swt(self): """Returns swt with non-None entries aligned in front. Empty entries equal to the number of vt entries are inserted at the beginning. """ - swt = [[] for v in self.__vt if not v is None] if self.__swt else [] + swt = [[] for v in self.__vt if not v is None] swt.extend([sw for sw in self.__swt if not sw == []]) swt.extend([[]] * (self.__nv - len(swt))) return swt @@ -346,10 +346,10 @@ def __write_intr_id_table(self, fp): fp.write("};\n") def write_source(self, fp): - vt = [v for v in self.__vt if not v is None] if self.__vt else [] - swt = [sw for sw in self.__swt if not sw == []] if self.__swt else [] + vt_len = len([v for v in self.__vt if not v is None]) if self.__vt else 0 + swt_len = len([sw for sw in self.__swt if not sw == []]) if self.__swt else 0 - if len(vt + swt) > self.__nv: + if (vt_len + swt_len) > self.__nv: self.__log.error("Too many ISRs are defined.") fp.write(self.source_header)