summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-08-12 07:25:17 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-08-12 07:25:17 +0200
commit40d45c0284838ce4df3ae8d36a867fa0d754e3a3 (patch)
treeec3e5df48716dd54a2c74ce612f0a81923e88d96
parenteb3b4a1672a1c8a64f1a17b97e80f8ffdae3f3f6 (diff)
Simplify _warn_select_unsatisfied_deps() a bit
select_val was only used in a single place, and there's no real harm in calculating expr_value(self.direct_dep) twice for a warning.
-rw-r--r--kconfiglib.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index 0f98fa5..1d9a907 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -3989,18 +3989,15 @@ class Symbol(object):
# and menus) is selected by some other symbol. Also warn if a symbol
# whose direct dependencies evaluate to m is selected to y.
- dir_dep_val = expr_value(self.direct_dep)
-
msg = "{} has direct dependencies {} with value {}, but is " \
"currently being {}-selected by the following symbols:" \
.format(_name_and_loc(self), expr_str(self.direct_dep),
- TRI_TO_STR[dir_dep_val],
+ TRI_TO_STR[expr_value(self.direct_dep)],
TRI_TO_STR[expr_value(self.rev_dep)])
# The reverse dependencies from each select are ORed together
for select in split_expr(self.rev_dep, OR):
- select_val = expr_value(select)
- if select_val <= dir_dep_val:
+ if expr_value(select) <= expr_value(self.direct_dep):
# Only include selects that exceed the direct dependencies
continue