Simplify perform_checks()
authorAlexander Popov <alex.popov@linux.com>
Thu, 5 Mar 2020 09:07:33 +0000 (12:07 +0300)
committerAlexander Popov <alex.popov@linux.com>
Thu, 5 Mar 2020 09:07:33 +0000 (12:07 +0300)
kconfig-hardened-check.py

index 56c52ecc1b3c154a5f7350d29676ab6191b36661..0975ba04042087fefe1ea9df5d57c4b62bc0b0b8 100755 (executable)
@@ -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()