lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20130321081043.21073.38947.stgit@zurg>
Date:	Thu, 21 Mar 2013 12:10:44 +0400
From:	Konstantin Khlebnikov <khlebnikov@...nvz.org>
To:	linux-kernel@...r.kernel.org
Cc:	Michal Marek <mmarek@...e.cz>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kbuild@...r.kernel.org
Subject: [PATCH] kconfig: print each first level disjunction block from a new
 line

This patch improves readability of complicated expressions.

before:
   Selected by: A && AA && AAA || B && BB && (BBB || BBBB) || C && CC && CCC

after:
   Selected by: A && AA && AAA
 || B && BB && (BBB || BBBB)
 || C && CC && CCC

Modules' config options usually comes first in these blocks.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@...nvz.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Michal Marek <mmarek@...e.cz>
Cc: linux-kbuild@...r.kernel.org
---
 scripts/kconfig/expr.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index d662652..e47eb28 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -1087,9 +1087,15 @@ void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *
 		fn(data, e->right.sym, e->right.sym->name);
 		break;
 	case E_OR:
-		expr_print(e->left.expr, fn, data, E_OR);
-		fn(data, NULL, " || ");
-		expr_print(e->right.expr, fn, data, E_OR);
+		if (prevtoken == E_NONE) {
+			expr_print(e->left.expr, fn, data, E_NONE);
+			fn(data, NULL, "\n|| ");
+			expr_print(e->right.expr, fn, data, E_NONE);
+		} else {
+			expr_print(e->left.expr, fn, data, E_OR);
+			fn(data, NULL, " || ");
+			expr_print(e->right.expr, fn, data, E_OR);
+		}
 		break;
 	case E_AND:
 		expr_print(e->left.expr, fn, data, E_AND);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ