File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1037,6 +1037,12 @@ config WARN_EXPERIMENTAL
1037
1037
Print a warning when the Kconfig tree is parsed if any experimental
1038
1038
features are enabled.
1039
1039
1040
+ config NOT_SECURE
1041
+ bool
1042
+ help
1043
+ Symbol to be selected by a feature to inidicate that feature is
1044
+ not secure.
1045
+
1040
1046
config TAINT
1041
1047
bool
1042
1048
help
Original file line number Diff line number Diff line change @@ -93,6 +93,8 @@ def main():
93
93
if kconf .syms .get ('WARN_EXPERIMENTAL' , kconf .y ).tri_value == 2 :
94
94
check_experimental (kconf )
95
95
96
+ check_not_secure (kconf )
97
+
96
98
# Hack: Force all symbols to be evaluated, to catch warnings generated
97
99
# during evaluation. Wait till the end to write the actual output files, so
98
100
# that we don't generate any output if there are warnings-turned-errors.
@@ -266,6 +268,16 @@ def check_experimental(kconf):
266
268
selector_name = split_expr (selector , AND )[0 ].name
267
269
warn (f'Experimental symbol { selector_name } is enabled.' )
268
270
271
+ def check_not_secure (kconf ):
272
+ not_secure = kconf .syms .get ('NOT_SECURE' )
273
+ dep_expr = kconf .n if not_secure is None else not_secure .rev_dep
274
+
275
+ if dep_expr is not kconf .n :
276
+ selectors = [s for s in split_expr (dep_expr , OR ) if expr_value (s ) == 2 ]
277
+ for selector in selectors :
278
+ selector_name = split_expr (selector , AND )[0 ].name
279
+ warn (f'Not secure symbol { selector_name } is enabled.' )
280
+
269
281
270
282
def promptless (sym ):
271
283
# Returns True if 'sym' has no prompt. Since the symbol might be defined in
Original file line number Diff line number Diff line change @@ -69,6 +69,12 @@ config WARN_DEPRECATED
69
69
Print a warning when the Kconfig tree is parsed if any deprecated
70
70
features are enabled.
71
71
72
+ config NOT_SECURE
73
+ bool
74
+ help
75
+ Symbol to be selected by a feature to inidicate that feature is
76
+ not secure.
77
+
72
78
rsource "images/Kconfig"
73
79
74
80
menu "Build options"
You can’t perform that action at this time.
0 commit comments