Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kconfig: change some expr_*() functions to bool

This clarifies the behavior of these functions.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+11 -10
+8 -7
scripts/kconfig/expr.c
··· 243 243 * equals some operand in the other (operands do not need to appear in the same 244 244 * order), recursively. 245 245 */ 246 - int expr_eq(struct expr *e1, struct expr *e2) 246 + bool expr_eq(struct expr *e1, struct expr *e2) 247 247 { 248 - int res, old_count; 248 + int old_count; 249 + bool res; 249 250 250 251 /* 251 252 * A NULL expr is taken to be yes, but there's also a different way to ··· 256 255 return expr_is_yes(e1) && expr_is_yes(e2); 257 256 258 257 if (e1->type != e2->type) 259 - return 0; 258 + return false; 260 259 switch (e1->type) { 261 260 case E_EQUAL: 262 261 case E_GEQ: ··· 293 292 printf(" ?\n"); 294 293 } 295 294 296 - return 0; 295 + return false; 297 296 } 298 297 299 298 /* ··· 805 804 return e; 806 805 } 807 806 808 - int expr_contains_symbol(struct expr *dep, struct symbol *sym) 807 + bool expr_contains_symbol(struct expr *dep, struct symbol *sym) 809 808 { 810 809 if (!dep) 811 - return 0; 810 + return false; 812 811 813 812 switch (dep->type) { 814 813 case E_AND: ··· 830 829 default: 831 830 ; 832 831 } 833 - return 0; 832 + return false; 834 833 } 835 834 836 835 bool expr_depends_symbol(struct expr *dep, struct symbol *sym)
+3 -3
scripts/kconfig/expr.h
··· 278 278 struct expr *expr_copy(const struct expr *org); 279 279 void expr_free(struct expr *e); 280 280 void expr_eliminate_eq(struct expr **ep1, struct expr **ep2); 281 - int expr_eq(struct expr *e1, struct expr *e2); 281 + bool expr_eq(struct expr *e1, struct expr *e2); 282 282 tristate expr_calc_value(struct expr *e); 283 283 struct expr *expr_eliminate_dups(struct expr *e); 284 284 struct expr *expr_transform(struct expr *e); 285 - int expr_contains_symbol(struct expr *dep, struct symbol *sym); 285 + bool expr_contains_symbol(struct expr *dep, struct symbol *sym); 286 286 bool expr_depends_symbol(struct expr *dep, struct symbol *sym); 287 287 struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym); 288 288 ··· 292 292 void expr_gstr_print_revdep(struct expr *e, struct gstr *gs, 293 293 tristate pr_type, const char *title); 294 294 295 - static inline int expr_is_yes(const struct expr *e) 295 + static inline bool expr_is_yes(const struct expr *e) 296 296 { 297 297 return !e || (e->type == E_SYMBOL && e->left.sym == &symbol_yes); 298 298 }