From fc12f69cd0d02466225b648f98693290c3dc7c44 Mon Sep 17 00:00:00 2001 From: Peter Mitsis Date: Thu, 7 Oct 2021 15:12:43 -0400 Subject: [PATCH] scripts: Resolve python check warnings Resolves two pylist check warnings that recommend using 'in'. Signed-off-by: Peter Mitsis --- scripts/gen_kobject_list.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/gen_kobject_list.py b/scripts/gen_kobject_list.py index b9b0ca1a346..89717742f51 100755 --- a/scripts/gen_kobject_list.py +++ b/scripts/gen_kobject_list.py @@ -452,7 +452,7 @@ def analyze_die_array(die): continue if not elements: - if type_offset in type_env.keys(): + if type_offset in type_env: mt = type_env[type_offset] if mt.has_kobject(): if isinstance(mt, KobjectType) and mt.name == STACK_TYPE: @@ -588,8 +588,7 @@ def find_kobjects(elf, syms): continue loc = die.attributes["DW_AT_location"] - if loc.form != "DW_FORM_exprloc" and \ - loc.form != "DW_FORM_block1": + if loc.form not in ("DW_FORM_exprloc", "DW_FORM_block1"): debug_die(die, "kernel object '%s' unexpected location format" % name) continue