Received: by 2002:aa6:c3ca:0:b029:c8:4414:5686 with SMTP id b10csp1816585lkq; Fri, 19 Mar 2021 12:36:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyr1Ek68vWHkII5DnKWvyuMnF7Sshk75MH+raoim2hpxH085OYQqhcnnKp1RXKUmE7rWOdJ X-Received: by 2002:a17:906:22d4:: with SMTP id q20mr6441363eja.54.1616182560524; Fri, 19 Mar 2021 12:36:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616182560; cv=none; d=google.com; s=arc-20160816; b=NcN+arjsfw7bm8O1nqLH93I0sN5znrG28OjCHu6MpQPIWgNcsN95KJWwgkq0DQ/AJl mo7gbVIzS5NhftxUECbnwRw2vN6lgFLlwHjvQvHsSOIUvROYEUxJD3VGofSjdgHyCsy7 8TVke8ujoBt7yux0PMgccBuFS58GQLzFeoAEltMn5vp/p7W/MG/maYNDZMsZmQ+yeuqH cgduBHUtj9zVtI7FInRpjn12UwlS+rfE0PVTl++lVI8iTEBeQ5tpmAgXKchmnECoGp6q SvVq116ouv2m9Pai0jpj9TWG3Ox2qOAQlxfbM+DgDuK9RFktjsHRSeRSK9fymbipTRSO nMRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=5yWe8Hx3mAzgD1cjJ6fOFRik6bzQ9/2qcyBrY/E5cZw=; b=MYXg5xjeLRj1x+uIxAeoOSJ44ZnlbK6IaVC0ZrQEhMJHlGrBb3s3eQK6zdy4Q2V0NX Qy+jQkv4l1piPOrNs5ptbEoKnyEbkUz8/w2QAZ46B8ChXUJgg37IGYf4t584ZwkDkT3x qhZCkChQu1GHf4NJl0LNeJ/j3YGiYsfVTqmMmtXR+vraPxrd0vrTuzWdMbZupbVwVJ2s UHgfTDFUJDVr5V798v2KrIZ0LUtEMNYMioJWlA7/ymmVvfhXM7wyGyz+pW5pZsIP/3yL W0UB0JYyb+XYXedeScDrpiHt5JX0i3e2s7Gdsr5ZKPteMMI+1KS/Ak/Dkx2+eUUZL+WV Cj8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=VPTcDjFr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q16si4898495ejd.145.2021.03.19.12.35.38; Fri, 19 Mar 2021 12:36:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=VPTcDjFr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230453AbhCSTcl (ORCPT + 99 others); Fri, 19 Mar 2021 15:32:41 -0400 Received: from mail-40136.protonmail.ch ([185.70.40.136]:43488 "EHLO mail-40136.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230439AbhCSTcQ (ORCPT ); Fri, 19 Mar 2021 15:32:16 -0400 Date: Fri, 19 Mar 2021 19:32:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1616182334; bh=5yWe8Hx3mAzgD1cjJ6fOFRik6bzQ9/2qcyBrY/E5cZw=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=VPTcDjFrZg96Qg6rq2J8Y02Dk/JQQeRfozk2s+srD9UjD0Pae7fK6jZNDHywDfuqv QoSNznF0Y2Fu4jTDqAJk/L+SSANzlOjC1UY1Wg3xQdatfMxPEN0RpfFzvhYhSQyJiN 2QUMKosKWmfk7SRf/0mU3sZQ9epU6CuhhWj/4PbMZjiD3QK+gG2IW07MhmyxT6sUCO eodVEOGQyuUh5Q5jN6LDpbSLJcAId8ASjVAil226Jker5X32wOdU5Nsb5P9VBi6pLX y55LyCt09La1xRauNB+ZoeTPU8uM972GPeG/Qu4pMgeUitOq53WFfTqlm6ACt+bqn7 ZwESYQTIpZtHQ== To: Masahiro Yamada From: Alexander Lobakin Cc: Alexander Lobakin , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH 2/2] kconfig: mention submenu type in comment blocks in .config Message-ID: <20210319193150.267510-3-alobakin@pm.me> In-Reply-To: <20210319193150.267510-1-alobakin@pm.me> References: <20210319193150.267510-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To have a better understanding of the dotconfig blocks, mention if a particular block-commented section is a choice or a menu{,config}. Before: CONFIG_TICK_ONESHOT=3Dy CONFIG_NO_HZ_COMMON=3Dy CONFIG_NO_HZ_IDLE=3Dy CONFIG_HIGH_RES_TIMERS=3Dy After: CONFIG_TICK_ONESHOT=3Dy CONFIG_NO_HZ_COMMON=3Dy CONFIG_NO_HZ_IDLE=3Dy CONFIG_HIGH_RES_TIMERS=3Dy Signed-off-by: Alexander Lobakin --- scripts/kconfig/confdata.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index e4f0a21fd469..3f50d8b82a54 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -822,6 +822,17 @@ int conf_write_defconfig(const char *filename) =09return 0; } +static const char *menu_type_string(const struct menu *menu) +{ +=09if (menu->sym && (menu->sym->flags & SYMBOL_CHOICE)) +=09=09return " choice"; + +=09if (menu->prompt && menu->prompt->type =3D=3D P_MENU) +=09=09return " menu"; + +=09return ""; +} + int conf_write(const char *name) { =09FILE *out; @@ -876,8 +887,8 @@ int conf_write(const char *name) =09=09=09str =3D menu_get_prompt(menu); =09=09=09fprintf(out, "\n" =09=09=09=09 "#\n" -=09=09=09=09 "# %s\n" -=09=09=09=09 "#\n", str); +=09=09=09=09 "# %s%s\n" +=09=09=09=09 "#\n", str, menu_type_string(menu)); =09=09=09need_newline =3D false; =09=09} @@ -905,7 +916,8 @@ int conf_write(const char *name) =09=09=09 (menu->prompt && menu->prompt->type =3D=3D P_MENU)) && =09=09=09 menu_is_visible(menu) && menu !=3D &rootmenu) { =09=09=09=09str =3D menu_get_prompt(menu); -=09=09=09=09fprintf(out, "# end of %s\n", str); +=09=09=09=09fprintf(out, "# end of %s%s\n", str, +=09=09=09=09=09menu_type_string(menu)); =09=09=09=09need_newline =3D true; =09=09=09} =09=09=09if (menu->next) { -- 2.31.0