From 5a2b22d70d1bf3610fb5ab94e63ee774f3a23421 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Thu, 5 Mar 2020 12:07:33 +0300 Subject: [PATCH] Simplify perform_checks() --- kconfig-hardened-check.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/kconfig-hardened-check.py b/kconfig-hardened-check.py index 56c52ec..0975ba0 100755 --- a/kconfig-hardened-check.py +++ b/kconfig-hardened-check.py @@ -417,17 +417,15 @@ def print_checklist(checklist, with_results): print() -def get_option_state(options, name): - return options.get(name, None) - - def perform_checks(checklist, parsed_options): for opt in checklist: if hasattr(opt, 'opts'): + # prepare ComplexOptCheck for o in opt.opts: - o.state = get_option_state(parsed_options, o.name) + o.state = parsed_options.get(o.name, None) else: - opt.state = get_option_state(parsed_options, opt.name) + # prepare OptCheck + opt.state = parsed_options.get(opt.name, None) opt.check() -- 2.31.1