<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Roman Zippel &lt;zippel@linux-m68k.org&gt;

This disables some debug prints, which are more confusing than helpful for
normal users.


---

 25-akpm/scripts/kconfig/expr.c |   50 ++++++++++++++++++++++-------------------
 25-akpm/scripts/kconfig/expr.h |    1 
 2 files changed, 28 insertions(+), 23 deletions(-)

diff -puN scripts/kconfig/expr.c~config-disable-debug-printks scripts/kconfig/expr.c
--- 25/scripts/kconfig/expr.c~config-disable-debug-printks	Tue Mar 16 18:21:31 2004
+++ 25-akpm/scripts/kconfig/expr.c	Tue Mar 16 18:21:31 2004
@@ -10,6 +10,8 @@
 #define LKC_DIRECT_LINK
 #include "lkc.h"
 
+#define DEBUG_EXPR	0
+
 struct expr *expr_alloc_symbol(struct symbol *sym)
 {
 	struct expr *e = malloc(sizeof(*e));
@@ -220,10 +222,12 @@ int expr_eq(struct expr *e1, struct expr
 		/* panic */;
 	}
 
-	print_expr(0, e1, 0);
-	printf(" = ");
-	print_expr(0, e2, 0);
-	printf(" ?\n");
+	if (DEBUG_EXPR) {
+		expr_fprint(e1, stdout);
+		printf(" = ");
+		expr_fprint(e2, stdout);
+		printf(" ?\n");
+	}
 
 	return 0;
 }
@@ -397,11 +401,13 @@ struct expr *expr_join_or(struct expr *e
 			return expr_alloc_symbol(&amp;symbol_yes);
 	}
 
-	printf("optimize ");
-	print_expr(0, e1, 0);
-	printf(" || ");
-	print_expr(0, e2, 0);
-	printf(" ?\n");
+	if (DEBUG_EXPR) {
+		printf("optimize (");
+		expr_fprint(e1, stdout);
+		printf(") || (");
+		expr_fprint(e2, stdout);
+		printf(")?\n");
+	}
 	return NULL;
 }
 
@@ -444,6 +450,11 @@ struct expr *expr_join_and(struct expr *
 		// (a) &amp;&amp; (a!='n') -&gt; (a)
 		return expr_alloc_symbol(sym1);
 
+	if ((e1-&gt;type == E_SYMBOL &amp;&amp; e2-&gt;type == E_UNEQUAL &amp;&amp; e2-&gt;right.sym == &amp;symbol_mod) ||
+	    (e2-&gt;type == E_SYMBOL &amp;&amp; e1-&gt;type == E_UNEQUAL &amp;&amp; e1-&gt;right.sym == &amp;symbol_mod))
+		// (a) &amp;&amp; (a!='m') -&gt; (a='y')
+		return expr_alloc_comp(E_EQUAL, sym1, &amp;symbol_yes);
+
 	if (sym1-&gt;type == S_TRISTATE) {
 		if (e1-&gt;type == E_EQUAL &amp;&amp; e2-&gt;type == E_UNEQUAL) {
 			// (a='b') &amp;&amp; (a!='c') -&gt; 'b'='c' ? 'n' : a='b'
@@ -483,11 +494,14 @@ struct expr *expr_join_and(struct expr *
 		    (e2-&gt;type == E_SYMBOL &amp;&amp; e1-&gt;type == E_UNEQUAL &amp;&amp; e1-&gt;right.sym == &amp;symbol_yes))
 			return NULL;
 	}
-	printf("optimize ");
-	print_expr(0, e1, 0);
-	printf(" &amp;&amp; ");
-	print_expr(0, e2, 0);
-	printf(" ?\n");
+
+	if (DEBUG_EXPR) {
+		printf("optimize (");
+		expr_fprint(e1, stdout);
+		printf(") &amp;&amp; (");
+		expr_fprint(e2, stdout);
+		printf(")?\n");
+	}
 	return NULL;
 }
 
@@ -1073,11 +1087,3 @@ void expr_fprint(struct expr *e, FILE *o
 {
 	expr_print(e, expr_print_file_helper, out, E_NONE);
 }
-
-void print_expr(int mask, struct expr *e, int prevtoken)
-{
-	if (!(cdebug &amp; mask))
-		return;
-	expr_fprint(e, stdout);
-}
-
diff -puN scripts/kconfig/expr.h~config-disable-debug-printks scripts/kconfig/expr.h
--- 25/scripts/kconfig/expr.h~config-disable-debug-printks	Tue Mar 16 18:21:31 2004
+++ 25-akpm/scripts/kconfig/expr.h	Tue Mar 16 18:21:31 2004
@@ -174,7 +174,6 @@ void expr_extract_eq(enum expr_type type
 struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym);
 
 void expr_fprint(struct expr *e, FILE *out);
-void print_expr(int mask, struct expr *e, int prevtoken);
 
 static inline int expr_is_yes(struct expr *e)
 {

_
</pre></body></html>