From patchwork Tue May 7 10:37:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13656602 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 284ED14F118; Tue, 7 May 2024 10:38:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715078313; cv=none; b=G/5dIToqFLTsXmSfCxU4tih7IY0F31ut6NE3Q25KvqO0lzj5rcv32vUtHWVMa3PCyixEbAqjRE49VadPTG9lrqFV/fP2OB9ZOw9sg4izDJBi3LKWuobfQgMF/vpKYY9qIwgEJ9M9/jAiL2yv3nuQQFSwGVjWPbGNSygThYVY2ko= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715078313; c=relaxed/simple; bh=vYIhtx5//lOdos3hdS0Nwm4Qqd6eR4mkO0PXsZgMCrI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=sEf0iH1D2tf9dBeudIbLlNB+sTyHpsNfrAr2EfZMiqmyeZYDWajOadpyZau7g5XePs4cYdGdaRH84x+kquIl6TCIwxxnl7HJ9xuZisBpMKSTLhuy4K82viY1zUlCcAHnqvb/3ourS7Dv2ndjJwMmZ/W0ZmzWuThEzOxEsBGKuwg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HV1QSW45; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HV1QSW45" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE52AC4AF66; Tue, 7 May 2024 10:38:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715078312; bh=vYIhtx5//lOdos3hdS0Nwm4Qqd6eR4mkO0PXsZgMCrI=; h=From:To:Cc:Subject:Date:From; b=HV1QSW45LiJ/gqfbd+PpuHXIezMDosOU8+SJ68cvnUQq8qFnqT9UYplJqfGr3L3oj k9VSFqPNM8gWrEO+Wddf8gIizS/UfAdKwOy3TKSERSiRDef4gYp7s6NLzqvjAZtnHz Rntq9k+HYiBZFlgV76obegc5ahgGN3L7kyTenLf0Y6d3q7ZGf/HJOKi245L9xLUsRG OOV2cZ2uCVy/G0HgVvrAxmmHThNzgSJA6j+2YLMdHO4hb4WputgZQiwF14eTR62Bxc 3TFn2CKmBGQ4SO2ijGSpkfUZ1IyEGwxfeYGakDM10C5nW9zqXMse4c/CWcLm+UKmN/ eLTqyfvb5lPVg== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 1/3] kconfig: m/nconf: remove dead code to display children of choice members Date: Tue, 7 May 2024 19:37:54 +0900 Message-Id: <20240507103756.1401996-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This code previously displayed child symbols of the selected choice member. Since commit 7e3465f63a0a ("kconfig: do not reparent the menu inside a choice block"), choice members never have child symbols, therefore this is dead code. Signed-off-by: Masahiro Yamada --- scripts/kconfig/mconf.c | 5 ----- scripts/kconfig/nconf.c | 5 ----- 2 files changed, 10 deletions(-) diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index c0969097447d..b33335eba460 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -551,11 +551,6 @@ static void build_conf(struct menu *menu) if (def_menu) { item_add_str(" (%s)", menu_get_prompt(def_menu)); item_add_str(" --->"); - if (def_menu->list) { - indent += 2; - build_conf(def_menu); - indent -= 2; - } } return; } diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index 9d22b0f3197b..b5b3232f592a 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -857,11 +857,6 @@ static void build_conf(struct menu *menu) item_add_str(" (%s)", menu_get_prompt(def_menu)); item_add_str(" --->"); - if (def_menu->list) { - indent += 2; - build_conf(def_menu); - indent -= 2; - } } return; } From patchwork Tue May 7 10:37:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13656603 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D6701514F5; Tue, 7 May 2024 10:38:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715078314; cv=none; b=bbu8O2Q5ZVmWcdv3gVsG2dN7PF0o4GEV70CBdoTRKMnqWl8mPbxfoLNM4g0pahqu5xYA1NiT+Et9LAc+ZwiM7Gr+BHDjp+V+4HPKg/trv2iBVTfgl0SU3haC18quAL570aArdj6CSzPF6nTuPFucvPJM5BR947zXfbMtEcc4X34= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715078314; c=relaxed/simple; bh=/8Wqr+SuY8M/oz8mz047pX05dfShxUAsQlubT6STB+c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WZBlPEwVsI29+tog4LHyshWsC9IzbHev5/O2SkRUQkBWbsX45VLZuabDCHjoIvNa6n9PPUF6bRatxN+obfP2xrslqr88YbOzo3t9ez54lIRoGjaVBKMSQL4KVT6Y+sIN654yCFWgWsHVo2FYue2HWrbajmrrB4bIkm09Nu8qDjo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=p7l0Ynxs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="p7l0Ynxs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D7FBC4AF63; Tue, 7 May 2024 10:38:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715078314; bh=/8Wqr+SuY8M/oz8mz047pX05dfShxUAsQlubT6STB+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p7l0YnxsvHNSJX6ml4H2vrHc/gu/GnALPSD8r0zP7IpBKm/cp8QoBZ/NsBu97Rf/C czhlDOBXZl8f66hsgovD/h5AaTfHYKbcfHkEV1QBPiUtzMFUG/edJrHgLzRVPU/sNz VogjpG7JRrPSO+paB64oGSDu42ZXALqWf8pqJz9ngXziZmqrW98Z9bo4aKSh7grS+O lZAzUDJ+I4k5pA+9XRNXgCHEGPE9Av8cY7JGMC+6+tPxDtPj0/B0aa46euqAaOH/9e pMrXPj+sk3HqXsIXW1xg6NQ4eWBOZuOLJtxq9IStd+jl4/jgOYdh35Hzg4+IVTDM64 dz1Kw9I66YR4g== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 2/3] kconfig: m/nconf: remove dead code to display value of bool choice Date: Tue, 7 May 2024 19:37:55 +0900 Message-Id: <20240507103756.1401996-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240507103756.1401996-1-masahiroy@kernel.org> References: <20240507103756.1401996-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Previously, optional bool choices met the following conditions simultaneously: - sym_is_choice(sym) - sym_is_changeable(sym) - type == S_BOOLEAN It no longer occurs since 6a1215888e23 ("kconfig: remove 'optional' property support"). Remove the dead code. Signed-off-by: Masahiro Yamada --- scripts/kconfig/mconf.c | 17 +++++------------ scripts/kconfig/nconf.c | 26 +++++++++----------------- 2 files changed, 14 insertions(+), 29 deletions(-) diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index b33335eba460..64bf373f7921 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -525,19 +525,12 @@ static void build_conf(struct menu *menu) val = sym_get_tristate_value(sym); if (sym_is_changeable(sym)) { - switch (type) { - case S_BOOLEAN: - item_make("[%c]", val == no ? ' ' : '*'); - break; - case S_TRISTATE: - switch (val) { - case yes: ch = '*'; break; - case mod: ch = 'M'; break; - default: ch = ' '; break; - } - item_make("<%c>", ch); - break; + switch (val) { + case yes: ch = '*'; break; + case mod: ch = 'M'; break; + default: ch = ' '; break; } + item_make("<%c>", ch); item_set_tag('t'); item_set_data(menu); } else { diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index b5b3232f592a..715e156fdbb1 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -826,26 +826,18 @@ static void build_conf(struct menu *menu) val = sym_get_tristate_value(sym); if (sym_is_changeable(sym)) { - switch (type) { - case S_BOOLEAN: - item_make(menu, 't', "[%c]", - val == no ? ' ' : '*'); + switch (val) { + case yes: + ch = '*'; break; - case S_TRISTATE: - switch (val) { - case yes: - ch = '*'; - break; - case mod: - ch = 'M'; - break; - default: - ch = ' '; - break; - } - item_make(menu, 't', "<%c>", ch); + case mod: + ch = 'M'; + break; + default: + ch = ' '; break; } + item_make(menu, 't', "<%c>", ch); } else { item_make(menu, def_menu ? 't' : ':', " "); } From patchwork Tue May 7 10:37:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13656604 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4C5815218C; Tue, 7 May 2024 10:38:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715078315; cv=none; b=mK/J2ED+YDaTSC2gJ5uvoj6XOd0aRqQODq+fv4fkPK0I/Pwcz18c7n0TU3iYe2VrcZklgrAjZVvlCIOE2VCHye97pY2w2CSsVpdOjJ+DZnXnfM42G+AT6DMb0WcEY9CuEnlH/tn2xWb5ZfMvfQNqB7ReuoHAFONwOnaNOtxDD58= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715078315; c=relaxed/simple; bh=fO4AOiqirq5leBzGVUM/FBhvC5TCNr4gtWamEvUwY6w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fDnRCIXA7fnTdF+AGHD4vaYRiufZoNLCvWecQKBJl2/CWHwM3NN0yjeGDCx8NGHQqXV2L/gZObD5IZEGGJpnhx15vgGafjVTPTWHFv3KM94cK+2k8kA4+LHKGmnADluD+qfqkfKMEi2smp3hXs06d3bqneZLai3MPWOBTChbOF0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hzr7eURA; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hzr7eURA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EBB2C3277B; Tue, 7 May 2024 10:38:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715078315; bh=fO4AOiqirq5leBzGVUM/FBhvC5TCNr4gtWamEvUwY6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hzr7eURASJuKTpSyFnJYXMva1FcDRG0qw+Ui5n/i8KqsXG4jItcccE6xB9xMFB4Qg MUMz3FXY8m+HPTwVND44/oh+REqCon0fqQC+asEYUKkCnqDUpbefmFFHZkOsQbbeax TAZVY/KyoVwKwMHJABnso6uoO/Jh4ur6HVSottKAeKec2NCdzKHYkvdd4kt3ZhuE8L c2kl/i9zlJcB6CgL32YsZu1LWlzvKJOlQz+KtCvzTg0CABhSQiuCO/IIayqS4lHvB+ QCVHBI9t7L6NrP7xyXatTlLPHd15KZd5QD1APAyVC3IKNYimkBLaE1I27ttOmMZK4f iBE0lt4ES+iQA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 3/3] kconfig: m/nconf: merge two item_add_str() calls Date: Tue, 7 May 2024 19:37:56 +0900 Message-Id: <20240507103756.1401996-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240507103756.1401996-1-masahiroy@kernel.org> References: <20240507103756.1401996-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Just trivial cleanups. Signed-off-by: Masahiro Yamada --- scripts/kconfig/mconf.c | 6 ++---- scripts/kconfig/nconf.c | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 64bf373f7921..33929b0b5ca8 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -541,10 +541,8 @@ static void build_conf(struct menu *menu) item_add_str("%*c%s", indent + 1, ' ', menu_get_prompt(menu)); if (val == yes) { - if (def_menu) { - item_add_str(" (%s)", menu_get_prompt(def_menu)); - item_add_str(" --->"); - } + if (def_menu) + item_add_str(" (%s) --->", menu_get_prompt(def_menu)); return; } } else { diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index 715e156fdbb1..a9ef2ced7d7a 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -845,11 +845,8 @@ static void build_conf(struct menu *menu) item_add_str("%*c%s", indent + 1, ' ', menu_get_prompt(menu)); if (val == yes) { - if (def_menu) { - item_add_str(" (%s)", - menu_get_prompt(def_menu)); - item_add_str(" --->"); - } + if (def_menu) + item_add_str(" (%s) --->", menu_get_prompt(def_menu)); return; } } else {