From patchwork Sun Nov 13 10:59:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13041509 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 798C3C4332F for ; Sun, 13 Nov 2022 10:59:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235097AbiKMK7x (ORCPT ); Sun, 13 Nov 2022 05:59:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231694AbiKMK7x (ORCPT ); Sun, 13 Nov 2022 05:59:53 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62FBCE0DD; Sun, 13 Nov 2022 02:59:52 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F271E60B7E; Sun, 13 Nov 2022 10:59:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AB80C433D6; Sun, 13 Nov 2022 10:59:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668337191; bh=ytDEwh2p3/GmsjCAZeZF4oTa+RhN2V2CD/3qB3C74Eo=; h=From:To:Cc:Subject:Date:From; b=qwYrk9K1L17SBP+99+zmlOZg0mbYvo/82xXoOOa/n7AsCpdS9cXFEUFl/4+8+1m0F eZ7DmUo5aqAsHGitWtKnyFHH/vin3DTw4JGeURCfFxqyg4XKfIH08FzQJXUuCwgQyq Pe1cJ/iTcPwKSxhAO9idhzEoLJ9YNxl0IqxAdssVn0PlmWDOIylkxZl7CftkHN8C5U CubPxXdp++GiM6U9i9VKGqlSAAGgCvVun4D9WcYVp5+gjMVSKueApnM1Z82oJ69+4L zw3UNQiaiSHp3Rb4FpsK0YGplOLVvip0FGN+HhmXXjczw6hSDAEbyTh77zpWPFFTuO MhedfUO+cDCRQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] kconfig: remove unneeded variable in get_prompt_str() Date: Sun, 13 Nov 2022 19:59:41 +0900 Message-Id: <20221113105943.3753945-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The variable 'accessible' is redundant. Signed-off-by: Masahiro Yamada --- scripts/kconfig/menu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 109325f31bef..b90fff833588 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -724,10 +724,8 @@ static void get_prompt_str(struct gstr *r, struct property *prop, menu = prop->menu; for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) { - bool accessible = menu_is_visible(menu); - submenu[i++] = menu; - if (location == NULL && accessible) + if (location == NULL && menu_is_visible(menu)) location = menu; } if (head && location) { From patchwork Sun Nov 13 10:59:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13041511 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8687FC433FE for ; Sun, 13 Nov 2022 11:00:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235323AbiKMK77 (ORCPT ); Sun, 13 Nov 2022 05:59:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235272AbiKMK74 (ORCPT ); Sun, 13 Nov 2022 05:59:56 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EED6CEE05; Sun, 13 Nov 2022 02:59:55 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0C666B80C03; Sun, 13 Nov 2022 10:59:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C27F5C433B5; Sun, 13 Nov 2022 10:59:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668337192; bh=uVh7d1ZdBvFF5UzVDHF1tphjemQ64fS1BQIfrjzswbg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I8LeTq35nKtbls63J4g7DR4Ng1p5D+BE7tAqosrLsX0Vr3ntlNML5OnOx6jPR7muE h/iCUEf3E41TryKvtPDBzEDAqZH4apUy4VgHffT+AfVq4LDGDBAU6D2AIzpd12Gjex 1stec85YCsBLyTvERfMAIWx3YYLC8jRue6p0uCnMadbX+iaAIKXN/CaEnNoGGprHI2 Q4OOEWQdAO68QhZA4ovSNvO62br7sDaT0WwcGBQNkKiKHgSLFz3GVoc6rDO+bUPY6S x2YoLwbfzejzti8E9wMIh2BPGnLMh9/Ar97hCKBDdpMvwQ/XRhFTsH+1+toTGbpBYS FiRmk6veIuS3Q== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] kconfig: remove const qualifier from str_get() Date: Sun, 13 Nov 2022 19:59:42 +0900 Message-Id: <20221113105943.3753945-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221113105943.3753945-1-masahiroy@kernel.org> References: <20221113105943.3753945-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org update_text() apparently edits the buffer returned by str_get(). (and there is no reason why it shouldn't) Remove 'const' quailifier and casting. Signed-off-by: Masahiro Yamada --- scripts/kconfig/lkc.h | 2 +- scripts/kconfig/mconf.c | 4 ++-- scripts/kconfig/util.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 6ac2eabe109d..e7118d62a45f 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -76,7 +76,7 @@ struct gstr str_new(void); void str_free(struct gstr *gs); void str_append(struct gstr *gs, const char *s); void str_printf(struct gstr *gs, const char *fmt, ...); -const char *str_get(struct gstr *gs); +char *str_get(struct gstr *gs); /* menu.c */ void _menu_init(void); diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 9d3cf510562f..d7f7e1bf7dd4 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -440,8 +440,8 @@ static void search_conf(void) res = get_relations_str(sym_arr, &head); set_subtitle(); - dres = show_textbox_ext("Search Results", (char *) - str_get(&res), 0, 0, keys, &vscroll, + dres = show_textbox_ext("Search Results", str_get(&res), 0, 0, + keys, &vscroll, &hscroll, &update_text, (void *) &data); again = false; diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c index 29585394df71..b78f114ad48c 100644 --- a/scripts/kconfig/util.c +++ b/scripts/kconfig/util.c @@ -74,7 +74,7 @@ void str_printf(struct gstr *gs, const char *fmt, ...) } /* Retrieve value of growable string */ -const char *str_get(struct gstr *gs) +char *str_get(struct gstr *gs) { return gs->s; } From patchwork Sun Nov 13 10:59:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13041510 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1B3BC4332F for ; Sun, 13 Nov 2022 10:59:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231694AbiKMK74 (ORCPT ); Sun, 13 Nov 2022 05:59:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235243AbiKMK7z (ORCPT ); Sun, 13 Nov 2022 05:59:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8029EE05; Sun, 13 Nov 2022 02:59:54 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6F2BA60B7E; Sun, 13 Nov 2022 10:59:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27B27C433D7; Sun, 13 Nov 2022 10:59:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668337193; bh=A7FQti5m/wYHdPhKdMyiYjVn1oIvpGLNd4xV582l6p4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CUodnP3ESQ4gJfqqJtLjdowamhxWOjPQ4lW6AEbCVfnICp/2AW5Pqn7Yh2UjdmrNr uS8x1U/V2ZZ6yWFLqUOkGg/rp3wGy6TbOCk5LZLXixIzIZ4ipoSlhLikpzobMt/BA6 vf6zJuD1zSuOWceDRRc+dR/HUYfmO3DRDoj3lxwcbaWhQwRXyp0bmczKqWoN62QylH ZYc/k6yV8GTueLW2Swre0IIAYLDhRQP7GvX1I0H8iRJJZ7RKuJvsD1ryGAsCWwFEvH LJGncv35xsPyevOXRfF/LBBzIc808Tn98X8khsZ6nXNiAZrD5NAZlm13EeY2qUrReO tfxFEbcLfY3hw== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] kconfig: remove redundant (void *) cast in search_conf() Date: Sun, 13 Nov 2022 19:59:43 +0900 Message-Id: <20221113105943.3753945-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221113105943.3753945-1-masahiroy@kernel.org> References: <20221113105943.3753945-1-masahiroy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The (void *) cast is redundant because the last argument of show_textbox_ext() is an opaque pointer. Signed-off-by: Masahiro Yamada --- scripts/kconfig/mconf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index d7f7e1bf7dd4..9c549683c627 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -441,8 +441,7 @@ static void search_conf(void) res = get_relations_str(sym_arr, &head); set_subtitle(); dres = show_textbox_ext("Search Results", str_get(&res), 0, 0, - keys, &vscroll, - &hscroll, &update_text, (void *) + keys, &vscroll, &hscroll, &update_text, &data); again = false; for (i = 0; i < JUMP_NB && keys[i]; i++)