diff --git a/kconfig-hardened-check.py b/kconfig-hardened-check.py index fea5ef9..6714f05 100755 --- a/kconfig-hardened-check.py +++ b/kconfig-hardened-check.py @@ -68,16 +68,11 @@ class OptCheck: return '{} = {}'.format(self.name, self.state) -class OR: +class ComplexOptCheck: def __init__(self, *opts): self.opts = opts self.result = None - # self.opts[0] is the option which this OR-check is about. - # Use case: - # OR(<X_is_hardened>, <X_is_disabled>) - # OR(<X_is_hardened>, <X_is_hardened_old>) - @property def name(self): return self.opts[0].name @@ -98,6 +93,13 @@ class OR: def reason(self): return self.opts[0].reason + +class OR(ComplexOptCheck): + # self.opts[0] is the option which this OR-check is about. + # Use case: + # OR(<X_is_hardened>, <X_is_disabled>) + # OR(<X_is_hardened>, <X_is_hardened_old>) + def check(self): for i, opt in enumerate(self.opts): result, msg = opt.check()