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