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: refactor expr_eliminate_dups()

Currently, expr_eliminate_dups() passes two identical pointers down to
expr_eliminate_dups1(), which later skips processing identical leaves.

This approach is somewhat tricky and, more importantly, it will not work
with the refactoring made in the next commit.

This commit slightly changes the recursion logic; it deduplicates both
the left and right arms, and then passes them to expr_eliminate_dups1().
expr_eliminate_dups() should produce the same result.

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

+3 -11
+3 -11
scripts/kconfig/expr.c
··· 578 578 579 579 /* *ep1 and *ep2 are leaves. Compare and process them. */ 580 580 581 - if (*ep1 == *ep2) 582 - return; 583 - 584 - switch ((*ep1)->type) { 585 - case E_OR: case E_AND: 586 - expr_eliminate_dups1((*ep1)->type, ep1, ep1); 587 - default: 588 - ; 589 - } 590 - 591 581 switch (type) { 592 582 case E_OR: 593 583 tmp = expr_join_or(*ep1, *ep2); ··· 624 634 trans_count = 0; 625 635 switch (e->type) { 626 636 case E_OR: case E_AND: 627 - expr_eliminate_dups1(e->type, &e, &e); 637 + e->left.expr = expr_eliminate_dups(e->left.expr); 638 + e->right.expr = expr_eliminate_dups(e->right.expr); 639 + expr_eliminate_dups1(e->type, &e->left.expr, &e->right.expr); 628 640 default: 629 641 ; 630 642 }