From patchwork Thu Mar 21 08:10:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 2311351 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 4A64440213 for ; Thu, 21 Mar 2013 08:10:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756692Ab3CUIKx (ORCPT ); Thu, 21 Mar 2013 04:10:53 -0400 Received: from mail-la0-f54.google.com ([209.85.215.54]:40981 "EHLO mail-la0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757858Ab3CUIKt (ORCPT ); Thu, 21 Mar 2013 04:10:49 -0400 Received: by mail-la0-f54.google.com with SMTP id gw10so4528639lab.41 for ; Thu, 21 Mar 2013 01:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:subject:to:from:cc:date:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=WajjTtblJv0AxIqWIBHxn/bkd+JlBr6Op8M2LqXAXp0=; b=tFgf6UCWodF9Zdr3WW0dmuoDYpT5+8Dmuc+dGqK7z6hCwJTYmJmFOK3shFn3LaUFU/ q4REcYTSbeVNPIYgxFmuQIzrMBjhZp8r4ZJc7BNv0cQrvIxqbzUC1hYh2/zSJzpXh8uR w7n39mAdzH/6RWoo4p0WVjMvf8xMni86rN/zfdFvAYk944QDW7HL8cKJqIKHdCqEPOhS GAbxCUFAiprYC7sadKLVsOLT2lu/TAKv/by6QNfjNOQtOlGVhgmKarpYzbjPVFhzTSpk AZf2y+Esn4obDxuOdX3IOf4CdALGM9fPPUHeLYCFCS+dLmOFIqDKCArw62g+JJi3D01W nIYw== X-Received: by 10.152.147.36 with SMTP id th4mr7170106lab.19.1363853447776; Thu, 21 Mar 2013 01:10:47 -0700 (PDT) Received: from localhost (swsoft-msk-nat.sw.ru. [195.214.232.10]) by mx.google.com with ESMTPS id pk1sm2092091lab.0.2013.03.21.01.10.46 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 21 Mar 2013 01:10:46 -0700 (PDT) Subject: [PATCH] kconfig: print each first level disjunction block from a new line To: linux-kernel@vger.kernel.org From: Konstantin Khlebnikov Cc: Michal Marek , Andrew Morton , linux-kbuild@vger.kernel.org Date: Thu, 21 Mar 2013 12:10:44 +0400 Message-ID: <20130321081043.21073.38947.stgit@zurg> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org 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 Cc: Andrew Morton Cc: Michal Marek Cc: linux-kbuild@vger.kernel.org --- scripts/kconfig/expr.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);