projects
/
kconfig-hardened-check.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Drop useless checks, the ComplexOptCheck constructor has already checked this
[kconfig-hardened-check.git]
/
kconfig_hardened_check
/
__init__.py
diff --git
a/kconfig_hardened_check/__init__.py
b/kconfig_hardened_check/__init__.py
index a2fe794ae623efb1d3f3602a49ff7d8897eac6bb..9cb16509d30e21d3d153cf53edd5d347b1bc3f7c 100644
(file)
--- a/
kconfig_hardened_check/__init__.py
+++ b/
kconfig_hardened_check/__init__.py
@@
-240,8
+240,6
@@
class OR(ComplexOptCheck):
# OR(<X_is_hardened>, <X_is_disabled>)
# OR(<X_is_hardened>, <old_X_is_hardened>)
def check(self):
# OR(<X_is_hardened>, <X_is_disabled>)
# OR(<X_is_hardened>, <old_X_is_hardened>)
def check(self):
- if not self.opts:
- sys.exit('[!] ERROR: invalid OR check')
for i, opt in enumerate(self.opts):
opt.check()
if opt.result.startswith('OK'):
for i, opt in enumerate(self.opts):
opt.check()
if opt.result.startswith('OK'):
@@
-287,7
+285,6
@@
class AND(ComplexOptCheck):
if not opt.result.startswith('FAIL: version'):
sys.exit('[!] ERROR: unexpected FAIL description "{}"'.format(opt.result))
return
if not opt.result.startswith('FAIL: version'):
sys.exit('[!] ERROR: unexpected FAIL description "{}"'.format(opt.result))
return
- sys.exit('[!] ERROR: invalid AND check')
def detect_arch(fname, archs):
def detect_arch(fname, archs):
@@
-851,6
+848,9
@@
def main():
config_checklist = []
if args.config:
config_checklist = []
if args.config:
+ if args.print:
+ sys.exit('[!] ERROR: --config and --print can\'t be used together')
+
if mode != 'json':
print('[+] Kconfig file to check: {}'.format(args.config))
if args.cmdline:
if mode != 'json':
print('[+] Kconfig file to check: {}'.format(args.config))
if args.cmdline: