Received: by 10.223.185.116 with SMTP id b49csp304273wrg; Tue, 20 Feb 2018 21:46:47 -0800 (PST) X-Google-Smtp-Source: AH8x225YXYBRy0w24c14k+OKWJVPEpHmOG8+ekz43mrLzO7tp+14HGiqSyVNiwF/Fsb6Xrll5ZqA X-Received: by 10.98.19.146 with SMTP id 18mr2153396pft.3.1519192007509; Tue, 20 Feb 2018 21:46:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519192007; cv=none; d=google.com; s=arc-20160816; b=dYYpj0iRiPjuCM06wYJRoI/7tRFWg3VpwfFYd3p3jnslsZcbckIAFV7Yy2b06iJ3lk vfJyjwGOTLT8a3PLPe8Oe6eHVzKdnQIirxAZk/SeBf6RPGnDTP9vCm/FDYahZP5wJ/ZL v4IKhtnDPOihcLoeNgcLyIAOmr5C4w4/G9uHQ/96WOHm9+2sCkNpPrZhGjdf0r4PQpZG uwyyLbVsENyDfZBcnqSKD+F7ZYGmTOudH1ttwPcSK6NuhObHsT5Fbw718q1/ucP8fd73 fdLX8wSVfMUqFsD8Arq0I4Av147ssuUzmWH9YYIBvImOHKRZ0aMcVK83QGMBnqzHPa5W zInw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=uPcE9baU0SJP+kNOObzXz/jr+oqsVRMp4/4gTa/HbRo=; b=PMAPfLed6pEERy58wjdC1FbsHZNpGsJTXkWN1uZ8bH2BEo4pRuSu+PWbTR6FZNnQ6r A5RxTFwpcCe6uljuUaTZXDzAcyxC4nbyvwiEkc7KCHvI8JtzuMLUr2Jrdgj848WilWmd QrUzewa3mSpe75IA7dBqCCLC2cf2eH2LqVmVQ7fRTxgrkLpPGtglnVDuTJUqywuU4lF+ Y+ZhGnXiz85GyiRwZMBLKvMikfJdJAsoTuZCRIATJPDMXwGkpbr2D+mUsPRNt9+jALJL WEG0FRNzTMKPkBJXAmPZfxxGCi+V6mo4248vgpmVZr27b41bYWoJ2NLcT7RYNs3sF5+o 8tTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=hSdjHCEM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1-v6si828946pls.184.2018.02.20.21.46.32; Tue, 20 Feb 2018 21:46:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=hSdjHCEM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751485AbeBUFpy (ORCPT + 99 others); Wed, 21 Feb 2018 00:45:54 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:18195 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750738AbeBUFpw (ORCPT ); Wed, 21 Feb 2018 00:45:52 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id w1L5iKjR027718; Wed, 21 Feb 2018 14:44:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w1L5iKjR027718 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1519191861; bh=uPcE9baU0SJP+kNOObzXz/jr+oqsVRMp4/4gTa/HbRo=; h=From:To:Cc:Subject:Date:From; b=hSdjHCEMw8WOCWhXqFs2Dk3ZweR5++fqzE8dyGlWyO3FgaGoH+yPBTeol2LkCXazf heWsXXLLZUvGuNg1+69Kc9dxYNazwETFVyJWskUwD2OsC3buGLAlPwyHOOzdy/rAtz JTbLWONXvfpa97FoAG64UGkVvujyrpCeM0nVYND5NO+QjnZwb4steg+6qYX2MJ0YLu t/FXE51/X6Gy4B3ea1QQT0nd14xnK/sMalKNzQcLAC7j7eBzwVheZZUKnXsRzEHyAj SQI1G6I2+6b9fMahcVWZfXC/oEDe0oJbWximoZ8w45M3kB4a9BrAmkg5YF9QGXWUTV Xw94laQuxkiCw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Ulf Magnusson , Eugeniu Rosca , Petr Vorel , Masahiro Yamada , "Luis R. Rodriguez" , Randy Dunlap , linux-kernel@vger.kernel.org, Nicolas Pitre Subject: [PATCH] kconfig: Print reverse dependencies in groups Date: Wed, 21 Feb 2018 14:44:15 +0900 Message-Id: <1519191855-27943-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Masahiro Yamada --- This patch requires the following as a pre-requisite: https://patchwork.kernel.org/patch/10229545/ These two will work equivalently to the following three: https://patchwork.kernel.org/patch/10226951/ https://patchwork.kernel.org/patch/10226953/ https://patchwork.kernel.org/patch/10226955/ scripts/kconfig/expr.c | 18 ++++++++++++------ scripts/kconfig/expr.h | 3 ++- scripts/kconfig/menu.c | 10 ++++++---- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index cd3a8f5..49376e1 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c @@ -1323,19 +1323,25 @@ void expr_gstr_print(struct expr *e, struct gstr *gs) */ static void expr_print_revdep(struct expr *e, void (*fn)(void *, struct symbol *, const char *), - void *data) + void *data, tristate pr_type, const char **title) { if (e->type == E_OR) { - expr_print_revdep(e->left.expr, fn, data); - expr_print_revdep(e->right.expr, fn, data); - } else { + expr_print_revdep(e->left.expr, fn, data, pr_type, title); + expr_print_revdep(e->right.expr, fn, data, pr_type, title); + } else if (expr_calc_value(e) == pr_type) { + if (*title) { + fn(data, NULL, *title); + *title = NULL; + } + fn(data, NULL, " - "); expr_print(e, fn, data, E_NONE); fn(data, NULL, "\n"); } } -void expr_gstr_print_revdep(struct expr *e, struct gstr *gs) +void expr_gstr_print_revdep(struct expr *e, struct gstr *gs, + tristate pr_type, const char *title) { - expr_print_revdep(e, expr_print_gstr_helper, gs); + expr_print_revdep(e, expr_print_gstr_helper, gs, pr_type, &title); } diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index c16e82e..8dbf2a4 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h @@ -310,7 +310,8 @@ struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2); void expr_fprint(struct expr *e, FILE *out); struct gstr; /* forward */ void expr_gstr_print(struct expr *e, struct gstr *gs); -void expr_gstr_print_revdep(struct expr *e, struct gstr *gs); +void expr_gstr_print_revdep(struct expr *e, struct gstr *gs, + tristate pr_type, const char *title); static inline int expr_is_yes(struct expr *e) { diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 7e70be3..3b9beca 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -827,14 +827,16 @@ static void get_symbol_str(struct gstr *r, struct symbol *sym, get_symbol_props_str(r, sym, P_SELECT, _(" Selects: ")); if (sym->rev_dep.expr) { - str_append(r, _(" Selected by: \n")); - expr_gstr_print_revdep(sym->rev_dep.expr, r); + expr_gstr_print_revdep(sym->rev_dep.expr, r, yes, " Selected by [y]\n"); + expr_gstr_print_revdep(sym->rev_dep.expr, r, mod, " Selected by [m]\n"); + expr_gstr_print_revdep(sym->rev_dep.expr, r, no, " Selected by [n]\n"); } get_symbol_props_str(r, sym, P_IMPLY, _(" Implies: ")); if (sym->implied.expr) { - str_append(r, _(" Implied by: \n")); - expr_gstr_print_revdep(sym->implied.expr, r); + expr_gstr_print_revdep(sym->rev_dep.expr, r, yes, " Implied by [y]\n"); + expr_gstr_print_revdep(sym->rev_dep.expr, r, mod, " Implied by [m]\n"); + expr_gstr_print_revdep(sym->rev_dep.expr, r, no, " Implied by [n]\n"); } str_append(r, "\n\n"); -- 2.7.4