diff options
| author | Masahiro Yamada <[email protected]> | 2024-09-08 12:43:17 +0000 |
|---|---|---|
| committer | Masahiro Yamada <[email protected]> | 2024-09-20 00:21:52 +0000 |
| commit | d607e0e7a8d2ea6565f11064d28b0825a95748aa (patch) | |
| tree | cdaac83b17634854044475976b3beae67d947529 /scripts/kconfig/expr.c | |
| parent | scripts: move hash function from scripts/kconfig/ to scripts/include/ (diff) | |
| download | kernel-d607e0e7a8d2ea6565f11064d28b0825a95748aa.tar.gz kernel-d607e0e7a8d2ea6565f11064d28b0825a95748aa.zip | |
kconfig: change some expr_*() functions to bool
This clarifies the behavior of these functions.
Signed-off-by: Masahiro Yamada <[email protected]>
Diffstat (limited to 'scripts/kconfig/expr.c')
| -rw-r--r-- | scripts/kconfig/expr.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index a16451347f63..d5dc682f7dc6 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c @@ -243,9 +243,10 @@ void expr_eliminate_eq(struct expr **ep1, struct expr **ep2) * equals some operand in the other (operands do not need to appear in the same * order), recursively. */ -int expr_eq(struct expr *e1, struct expr *e2) +bool expr_eq(struct expr *e1, struct expr *e2) { - int res, old_count; + int old_count; + bool res; /* * A NULL expr is taken to be yes, but there's also a different way to @@ -255,7 +256,7 @@ int expr_eq(struct expr *e1, struct expr *e2) return expr_is_yes(e1) && expr_is_yes(e2); if (e1->type != e2->type) - return 0; + return false; switch (e1->type) { case E_EQUAL: case E_GEQ: @@ -292,7 +293,7 @@ int expr_eq(struct expr *e1, struct expr *e2) printf(" ?\n"); } - return 0; + return false; } /* @@ -804,10 +805,10 @@ struct expr *expr_transform(struct expr *e) return e; } -int expr_contains_symbol(struct expr *dep, struct symbol *sym) +bool expr_contains_symbol(struct expr *dep, struct symbol *sym) { if (!dep) - return 0; + return false; switch (dep->type) { case E_AND: @@ -829,7 +830,7 @@ int expr_contains_symbol(struct expr *dep, struct symbol *sym) default: ; } - return 0; + return false; } bool expr_depends_symbol(struct expr *dep, struct symbol *sym) |
