diff options
| -rw-r--r-- | Documentation/kbuild/kconfig-language.txt | 23 | ||||
| -rw-r--r-- | scripts/kconfig/expr.c | 5 |
2 files changed, 19 insertions, 9 deletions
diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt index 262722d8867b..c4a293a03c33 100644 --- a/Documentation/kbuild/kconfig-language.txt +++ b/Documentation/kbuild/kconfig-language.txt | |||
| @@ -200,10 +200,14 @@ module state. Dependency expressions have the following syntax: | |||
| 200 | <expr> ::= <symbol> (1) | 200 | <expr> ::= <symbol> (1) |
| 201 | <symbol> '=' <symbol> (2) | 201 | <symbol> '=' <symbol> (2) |
| 202 | <symbol> '!=' <symbol> (3) | 202 | <symbol> '!=' <symbol> (3) |
| 203 | '(' <expr> ')' (4) | 203 | <symbol1> '<' <symbol2> (4) |
| 204 | '!' <expr> (5) | 204 | <symbol1> '>' <symbol2> (4) |
| 205 | <expr> '&&' <expr> (6) | 205 | <symbol1> '<=' <symbol2> (4) |
| 206 | <expr> '||' <expr> (7) | 206 | <symbol1> '>=' <symbol2> (4) |
| 207 | '(' <expr> ')' (5) | ||
| 208 | '!' <expr> (6) | ||
| 209 | <expr> '&&' <expr> (7) | ||
| 210 | <expr> '||' <expr> (8) | ||
| 207 | 211 | ||
| 208 | Expressions are listed in decreasing order of precedence. | 212 | Expressions are listed in decreasing order of precedence. |
| 209 | 213 | ||
| @@ -214,10 +218,13 @@ Expressions are listed in decreasing order of precedence. | |||
| 214 | otherwise 'n'. | 218 | otherwise 'n'. |
| 215 | (3) If the values of both symbols are equal, it returns 'n', | 219 | (3) If the values of both symbols are equal, it returns 'n', |
| 216 | otherwise 'y'. | 220 | otherwise 'y'. |
| 217 | (4) Returns the value of the expression. Used to override precedence. | 221 | (4) If value of <symbol1> is respectively lower, greater, lower-or-equal, |
| 218 | (5) Returns the result of (2-/expr/). | 222 | or greater-or-equal than value of <symbol2>, it returns 'y', |
| 219 | (6) Returns the result of min(/expr/, /expr/). | 223 | otherwise 'n'. |
| 220 | (7) Returns the result of max(/expr/, /expr/). | 224 | (5) Returns the value of the expression. Used to override precedence. |
| 225 | (6) Returns the result of (2-/expr/). | ||
| 226 | (7) Returns the result of min(/expr/, /expr/). | ||
| 227 | (8) Returns the result of max(/expr/, /expr/). | ||
| 221 | 228 | ||
| 222 | An expression can have a value of 'n', 'm' or 'y' (or 0, 1, 2 | 229 | An expression can have a value of 'n', 'm' or 'y' (or 0, 1, 2 |
| 223 | respectively for calculations). A menu entry becomes visible when its | 230 | respectively for calculations). A menu entry becomes visible when its |
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index cbf4996dd9c1..8cee597d33a5 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c | |||
| @@ -893,7 +893,10 @@ static enum string_value_kind expr_parse_string(const char *str, | |||
| 893 | switch (type) { | 893 | switch (type) { |
| 894 | case S_BOOLEAN: | 894 | case S_BOOLEAN: |
| 895 | case S_TRISTATE: | 895 | case S_TRISTATE: |
| 896 | return k_string; | 896 | val->s = !strcmp(str, "n") ? 0 : |
| 897 | !strcmp(str, "m") ? 1 : | ||
| 898 | !strcmp(str, "y") ? 2 : -1; | ||
| 899 | return k_signed; | ||
| 897 | case S_INT: | 900 | case S_INT: |
| 898 | val->s = strtoll(str, &tail, 10); | 901 | val->s = strtoll(str, &tail, 10); |
| 899 | kind = k_signed; | 902 | kind = k_signed; |
