Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kernel-hardening-checker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
kernel-hardening-checker
Commits
51a3a89b
Commit
51a3a89b
authored
Jul 23, 2023
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor populate_opt_with_data()
Much better code, no functional changes
parent
e6963df5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
engine.py
kconfig_hardened_check/engine.py
+7
-8
No files found.
kconfig_hardened_check/engine.py
View file @
51a3a89b
...
...
@@ -269,17 +269,16 @@ def populate_simple_opt_with_data(opt, data, data_type):
def
populate_opt_with_data
(
opt
,
data
,
data_type
):
if
opt
.
type
==
'complex'
:
assert
(
opt
.
type
!=
'version'
),
'a single VersionCheck is useless'
if
opt
.
type
!=
'complex'
:
populate_simple_opt_with_data
(
opt
,
data
,
data_type
)
else
:
for
o
in
opt
.
opts
:
if
o
.
type
==
'complex'
:
if
o
.
type
!=
'complex'
:
populate_simple_opt_with_data
(
o
,
data
,
data_type
)
else
:
# Recursion for nested ComplexOptCheck objects
populate_opt_with_data
(
o
,
data
,
data_type
)
else
:
populate_simple_opt_with_data
(
o
,
data
,
data_type
)
else
:
assert
(
opt
.
type
!=
'version'
),
\
'a simple check with a single VersionCheck is useless'
populate_simple_opt_with_data
(
opt
,
data
,
data_type
)
def
populate_with_data
(
checklist
,
data
,
data_type
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment