From patchwork Sun Feb 18 21:05:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugeniu Rosca X-Patchwork-Id: 10226957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 68FE560244 for ; Sun, 18 Feb 2018 21:05:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55CFF28894 for ; Sun, 18 Feb 2018 21:05:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45C6A288E1; Sun, 18 Feb 2018 21:05:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE68F28894 for ; Sun, 18 Feb 2018 21:05:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751806AbeBRVFX (ORCPT ); Sun, 18 Feb 2018 16:05:23 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:53869 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751758AbeBRVFW (ORCPT ); Sun, 18 Feb 2018 16:05:22 -0500 Received: by mail-wm0-f65.google.com with SMTP id t74so11760619wme.3 for ; Sun, 18 Feb 2018 13:05:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=OQjSrEsuWbvJC0dcRScg3S67uuloERmF27WryKRBI48=; b=SQ/kCG0/ntnRnn1zN75F25akJ08ppOZMik3MPG3HXF25MV+6W1yt1I2v7fbGqYRObr CS4pR70tjW2aNnR3wlaXeNwW5SH4fTvLFp5Pgmei9di6HjMpL3iZgmQWeDSp0GPWMGPo ug4nxLmwNYdBVuXwmyDh2dcw8YIcwGlZNHRzmsZa9myRlVkZvD73cWJw252NvN0H7LIL R3j2dVq7FmXYr9Cn711X4da1vXdq3HnB4ikP1hJrGU2daFsrm3K2M8SfNMMQ8svFa2QH 9RO9AN3pHJnEfDBCgFq2XVTWYN5ISuf7qWKUqPkOuqEhMvEiAIWpKriNEsgCWS8LTDgp yDEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=OQjSrEsuWbvJC0dcRScg3S67uuloERmF27WryKRBI48=; b=kChnYmEHLQGUlCUK122s/bCKG+PLeS5HLz4mgY9pjzXB9vnOIYdFUu9wvoY4u1T+jV wrhuKXWL/H7qT2yPE8wpxdtH9W2D+D7IowMnTThPMEkcEgw3BCgBi9Ttocy6qd322Kn+ VWTmbiOFyUVg/mhErGJ5crceLvAYiHFRtG47qXz5SBZ0PUzCcu3SJKFY7yhxnAiRKI9H ynEzCzloE52b2FALCSdlc4uDR8cgK8IlzJjdIslFwG5ZuL5tU8ca2Tbx7j3oiXI099z1 +5AYEVqlMvU34dwQj0Vk3Hb8dRdVkMGZws/1kQ/soPLplY2mxQBDxxpxB0Q3SjSDkxSx VHfQ== X-Gm-Message-State: APf1xPBBZUlg5sCgyVUnyGxkaGArEal10BT49YtUESOrNL5M3w0rqjoI +UtIFeM8DLCZLVQ5cg+qKBQ= X-Google-Smtp-Source: AH8x224MiG42y0+h8oeLgLgknyKBCDkt+4Frr1W01Qcj5nTFGVUm905IwTcVaTGq3hQB4SRllDXTAw== X-Received: by 10.80.212.43 with SMTP id t43mr3771112edh.53.1518987921288; Sun, 18 Feb 2018 13:05:21 -0800 (PST) Received: from example.com ([2a02:8108:91c0:4bcc:98e2:b49f:4e58:283e]) by smtp.gmail.com with ESMTPSA id p93sm11775710edp.63.2018.02.18.13.05.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Feb 2018 13:05:20 -0800 (PST) From: Eugeniu Rosca X-Google-Original-From: Eugeniu Rosca Date: Sun, 18 Feb 2018 22:05:15 +0100 To: Ulf Magnusson Cc: Eugeniu Rosca , Masahiro Yamada , Petr Vorel , Nicolas Pitre , Randy Dunlap , Paul Bolle , Linux Kbuild mailing list , Eugeniu Rosca Subject: Re: [PATCH v3 3/3] kconfig: Print reverse dependencies in groups Message-ID: <20180218210515.GA13612@example.com> References: <0ed37972989a9ba7a8b50777bd60ea8f46495a2a.1518826148.git.erosca@de.adit-jv.com> <20180218110702.GA26185@example.com> <20180218130246.eqfa46eswut5xwmv@huvuddator> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Ulf, Sometimes having so many options (all of them being equally clean, simple and elegant) can make the choice really hard :D Below is the interdiff between v3 and v4. Hopefully other people will also like this series and we will see it in in some weeks. Thank you very much for your support. Best regards, Eugeniu. --- 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 48b99371d276..95dc058a236f 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c @@ -1180,13 +1180,19 @@ struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2) } static void -expr_print_newline(struct expr *e, - void (*fn)(void *, struct symbol *, const char *), - void *data, - int prevtoken) +expr_print_revdep(struct expr *e, + void (*fn)(void *, struct symbol *, const char *), + void *data, + int prevtoken, + enum print_type type) { - fn(data, NULL, "\n - "); - expr_print(e, fn, data, prevtoken); + if (type == PRINT_REVDEP_ALL || + type == PRINT_REVDEP_YES && expr_calc_value(e) == yes || + type == PRINT_REVDEP_MOD && expr_calc_value(e) == mod || + type == PRINT_REVDEP_NO && expr_calc_value(e) == no) { + fn(data, NULL, "\n - "); + expr_print(e, fn, data, prevtoken); + } } static void @@ -1211,21 +1217,10 @@ __expr_print(struct expr *e, fn(data, e->left.sym, e->left.sym->name); break; case PRINT_REVDEP_ALL: - expr_print_newline(e, fn, data, E_OR); - break; case PRINT_REVDEP_YES: - if (expr_calc_value(e) == yes) - expr_print_newline(e, fn, data, E_OR); - break; case PRINT_REVDEP_MOD: - if (expr_calc_value(e) == mod) - expr_print_newline(e, fn, data, E_OR); - break; case PRINT_REVDEP_NO: - if (expr_calc_value(e) == no) - expr_print_newline(e, fn, data, E_OR); - break; - default: + expr_print_revdep(e, fn, data, E_OR, type); break; } else @@ -1283,21 +1278,10 @@ __expr_print(struct expr *e, expr_print(e->right.expr, fn, data, E_AND); break; case PRINT_REVDEP_ALL: - expr_print_newline(e, fn, data, E_OR); - break; case PRINT_REVDEP_YES: - if (expr_calc_value(e) == yes) - expr_print_newline(e, fn, data, E_OR); - break; case PRINT_REVDEP_MOD: - if (expr_calc_value(e) == mod) - expr_print_newline(e, fn, data, E_OR); - break; case PRINT_REVDEP_NO: - if (expr_calc_value(e) == no) - expr_print_newline(e, fn, data, E_OR); - break; - default: + expr_print_revdep(e, fn, data, E_OR, type); break; } break; diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index d13ffa69d65b..029da77fe1b0 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -797,19 +797,19 @@ void get_revdep_by_type(struct expr *e, char *s, struct gstr *r) if (expr_revdep_contains(e, yes)) { str_append(r, s); - str_append(r, _(" [y]:")); + str_append(r, " [y]:"); expr_gstr_print_revdep(e, r, PRINT_REVDEP_YES); str_append(r, "\n"); } if (expr_revdep_contains(e, mod)) { str_append(r, s); - str_append(r, _(" [m]:")); + str_append(r, " [m]:"); expr_gstr_print_revdep(e, r, PRINT_REVDEP_MOD); str_append(r, "\n"); } if (expr_revdep_contains(e, no)) { str_append(r, s); - str_append(r, _(" [n]:")); + str_append(r, " [n]:"); expr_gstr_print_revdep(e, r, PRINT_REVDEP_NO); str_append(r, "\n"); }