From patchwork Sat Jun 1 18:20:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13682533 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 DCA0C1171D; Sat, 1 Jun 2024 18:20:49 +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=1717266050; cv=none; b=KdgedI6G4cubygOkEV0L8EjUwU4HNYUXw1V/2lY3o3A9y0lcb1ZPNTp30moejB4Jl+zusBjwhUmDp6FUqfEA3Pk+9BOPxOYab2eClq1z7WEzcjDjqltnPffkMOkQuz5uzTwPyqHdueFkBsrZvsT0MIqgaKJfw3eR86XTnStK5yA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717266050; c=relaxed/simple; bh=BuND9162WRwUGkN0x/0r2+6kLEtp01n8cDxLZ4FYcdU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=pnMuFJWQ1oymwrwq23gVdziTmAm0dHfVXNln8EU749VRgXoMZddtRwnx9DdLRmXbgKQTapyoS5VX1S/WzXfCwAE8tayq9L75DrtOmJx0X7S/9KTs9XN+pgO3PAh7SLtrN30aLmWW6+0dia18mevjwrzBOvCQ24pf+m+c5C7jJ+Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CxyaOpfl; 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="CxyaOpfl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D491C116B1; Sat, 1 Jun 2024 18:20:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717266049; bh=BuND9162WRwUGkN0x/0r2+6kLEtp01n8cDxLZ4FYcdU=; h=From:To:Cc:Subject:Date:From; b=CxyaOpfldcpC2z5qicSfy4up96V4iORtuHmZqeCW+Dcbou/W6zQG/wSwpBi6WHoJW Ree8Am9nxvp8m9/E7VVtWnt4sdv8b1Sg0J2ENeMoFjdUY/xG8I3sewZ/sIgvL0K/Am HUfPx4lhuYj+XGd5dhsDOW49oTe5my9EOHNjRM4u96zjF+PO1mmpQoHhW54JCB1crt FxC1of9X20TGhUtGSD32K9g9PFKNpoKvKXyITlhivN5c9e/CQ71Xwo9okLQ/mBP84m EVd+KVDJY+ZnDdm5HKVySia0xkO0BoifYq1sxnhydhmY+1RZAqFvPTlhbGIu6/LTgW o+pLlum+QQUug== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 1/6] kconfig: remove unneeded code for user-supplied values being out of range Date: Sun, 2 Jun 2024 03:20:38 +0900 Message-Id: <20240601182043.876249-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 is a leftover from commit ce1fc9345a59 ("kconfig: do not clear SYMBOL_DEF_USER when the value is out of range"). This code is now redundant because if a user-supplied value is out of range, the value adjusted by sym_validate_range() differs, and conf_unsaved has already been incremented a few lines above. Signed-off-by: Masahiro Yamada --- scripts/kconfig/confdata.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 387503daf0f7..85b53069ba7a 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -533,19 +533,6 @@ int conf_read(const char *name) */ if (sym->visible == no && !conf_unsaved) sym->flags &= ~SYMBOL_DEF_USER; - switch (sym->type) { - case S_STRING: - case S_INT: - case S_HEX: - /* Reset a string value if it's out of range */ - if (sym_string_within_range(sym, sym->def[S_DEF_USER].val)) - break; - sym->flags &= ~SYMBOL_VALID; - conf_unsaved++; - break; - default: - break; - } } } From patchwork Sat Jun 1 18:20:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13682534 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 21F63154BF3; Sat, 1 Jun 2024 18:20:50 +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=1717266051; cv=none; b=FqWRCMEnAsk/TKB3kLnxyvfxT6Ho1G2xX6vsrMrgWwAcuBFiN3tvcwizHg14MkgzQbGo9Gcyebaj3KJP6QvVpsTVdi8pXSIcC5drmTG8s/5fXriK2GQ9KXmsvibg6rHje+Y4fvIAYRQV/NobNUmL5dPcFF7lZYQSitMMVJxsP4A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717266051; c=relaxed/simple; bh=Nk5C1FaiT9kwsn9EFyyDDVmPydOKPpYhad1CZ+NAQRg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZHU45hW+jOADv9QLcP1TzXnBFTS6+mD5OLXJv7foC5NoaEwLun4q2G9AO+kxkVaOdzeBPNP3h/QzQqGhjxZsG8pf3kgu8n2rdhbaarbD171wb8wiw9ByMvazCI/pn0hJSe3GtOOEv+8hqYnOqjk8Ji0lDQ4G71uihTd++8g1Mpk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SQhX8piV; 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="SQhX8piV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 005B4C4AF07; Sat, 1 Jun 2024 18:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717266050; bh=Nk5C1FaiT9kwsn9EFyyDDVmPydOKPpYhad1CZ+NAQRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SQhX8piV+/s9c328uZsUOfQTXSaTcjbJCYh6gR6HDs1qhl3eWy1n7sEJapgeehFp0 UyCuquLAS9MOFj5Mja0XEQU/vu3ko2C+FE4UmDDZqdq5RS4VJ0XSgW5TmGtFufq7Pm qcuW0IqTG7BZiaEsv304ktnrKyCZxVDCLD7gtjiJcvXbmMV55rc2ts3lGGU4q4A3Yq LRI0KkbKiAgq4CXFPLJqsYTeuS/TXZQM2s6TBUESFosydKTAuyPIIh6MZULRB9DP+s 51eDzI8No/soav7j4OqdEzgr/GKizaDsz0ctlChmBJTabOsXwnFFw0JD0XGL7gjSGb zfPm3fcXQUg1A== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 2/6] kconfig: qconf: remove initial call to conf_changed() Date: Sun, 2 Jun 2024 03:20:39 +0900 Message-Id: <20240601182043.876249-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240601182043.876249-1-masahiroy@kernel.org> References: <20240601182043.876249-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 If any CONFIG option is changed while loading the .config file, conf_read() calls conf_set_changed(true) and then the conf_changed() callback. With conf_read() moved after window initialization, the explicit conf_changed() call can be removed. Signed-off-by: Masahiro Yamada --- scripts/kconfig/qconf.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index c6c42c0f4e5d..e62e862ea283 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1397,8 +1397,6 @@ ConfigMainWindow::ConfigMainWindow(void) conf_set_changed_callback(conf_changed); - // Set saveAction's initial state - conf_changed(); configname = xstrdup(conf_get_configname()); QAction *saveAsAction = new QAction("Save &As...", this); @@ -1904,7 +1902,6 @@ int main(int ac, char** av) conf_parse(name); fixup_rootmenu(&rootmenu); - conf_read(NULL); //zconfdump(stdout); configApp = new QApplication(ac, av); @@ -1916,6 +1913,9 @@ int main(int ac, char** av) //zconfdump(stdout); configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit())); configApp->connect(configApp, SIGNAL(aboutToQuit()), v, SLOT(saveSettings())); + + conf_read(NULL); + v->show(); configApp->exec(); From patchwork Sat Jun 1 18:20:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13682535 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 02A4B154C11; Sat, 1 Jun 2024 18:20:51 +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=1717266052; cv=none; b=uEXx1W5RHi65XITgPQzFJljXxtTvLJPb2fiChzrS7vBDuVoYtMoBPu4rfZQTGQ8Uea3DGwxdn1MjrjMzmrEornoXMOshwQL9wwaHmVTr6PFvoiCdLB+pFwzYX83rN+SmUIQzEvFpKv9RW9bCQ6PFeTq7H/61t0ABvJ7CGbp2RhM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717266052; c=relaxed/simple; bh=Fa0ZdWT04XOLV0C1EfvYkbNp8hQC0YdrqUUBf3fi3LQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jlLFgbP93+xeX0azf7l2GHVxWXN0iO+IkIMOc6NpXTpqurjl4kzRj3p73s2ClMjbPNdPI3Pg3pyPYZeF6JMeGvDrZ3clRTZTyiL4bD32FF8muNqf7CW/gcZeIINA/wlNahXhPzs3B5vlnzr9RgIeXaOiMVZxCs/xCqE887s8CFA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vKYs766B; 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="vKYs766B" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21BD5C116B1; Sat, 1 Jun 2024 18:20:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717266051; bh=Fa0ZdWT04XOLV0C1EfvYkbNp8hQC0YdrqUUBf3fi3LQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vKYs766BerGvHqBbKZ08uuTPATpRqpnvr+V9M7M/4WV2oBXKf3M3KTD5X0LO2dp6P GUon2748+68oYULkpfCzF04fj+xiBf9tANhAw1t74cNnwFC5yblmv1ZNHUyIQEo6RG hfWVkRV6sP15F09UhzEaGXIcQgBrKC/+imi2VKWqtDnBdEbHmEZclPKEWGY0zXhB1B fRW+eQs0NbaBgiOHP+Xp7ypLfPnONWCankttt9Z90AmBXT5e1+NzdcuP0jhtglmHcT 2th7F3EC0im731l9OaE9d369bnJj0QGq1+peKJx+hkSdwECsGl+PQE9NTBnxO+mG48 /R5G9T44MVdVA== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 3/6] kconfig: gconf: give a proper initial state to the Save button Date: Sun, 2 Jun 2024 03:20:40 +0900 Message-Id: <20240601182043.876249-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240601182043.876249-1-masahiroy@kernel.org> References: <20240601182043.876249-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Currently, the initial state of the "Save" button is always active. If none of the CONFIG options are changed while loading the .config file, the "Save" button should be greyed out. This can be fixed by calling conf_read() after widget initialization. Signed-off-by: Masahiro Yamada --- scripts/kconfig/gconf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index cc400ffe6615..e04dbafd3add 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -1422,7 +1422,6 @@ int main(int ac, char *av[]) conf_parse(name); fixup_rootmenu(&rootmenu); - conf_read(NULL); /* Load the interface and connect signals */ init_main_window(glade_file); @@ -1430,6 +1429,8 @@ int main(int ac, char *av[]) init_left_tree(); init_right_tree(); + conf_read(NULL); + switch (view_mode) { case SINGLE_VIEW: display_tree_part(); From patchwork Sat Jun 1 18:20:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13682536 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 50ECD1552FD; Sat, 1 Jun 2024 18:20:53 +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=1717266053; cv=none; b=sCk7XlkItu1205nT02pH2Ujp8qys4inyKHnms0K2Pq4yF6w9FaxS9nsplgrEM0vxGVEMpN5B30PZZCxOIHeWFvwIhZ5tPibaXiFrFOlidXBXcahd0q6HrObGaBARQ5URlGYALTudZUM6C08xltUzOWIWX8ZufFuli72jtQh9qgo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717266053; c=relaxed/simple; bh=E5F85lghawtKZIpSKTiIrIxMrzChAjDS5P3cWNMvaVc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tlaF5KN4VFXwgU6WmOfjwhAPojE0qSsaOKMzzo4W19Xv9vgT5Gx7hWG6j7bOEsJSfQttnpdQ76A3qmlUTS6TrhNr5TXqJiQFMM/Q3cul5Dm1gniurJFaEM6iFbZ+gYCLYjAfWg33iJ+UfwjSbqB4PwYvgw0dNJvl/k+NiPwRYkg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Hp43+kMM; 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="Hp43+kMM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7004BC116B1; Sat, 1 Jun 2024 18:20:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717266053; bh=E5F85lghawtKZIpSKTiIrIxMrzChAjDS5P3cWNMvaVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hp43+kMMvdapXkJayMV2F4P1s1euj8BrDdRb9BHny9uLqM86qa6I4rRvQw0Q1NNe2 VcsVs4Hdk4cRywqFb50IbbMXKuIID/NYbkWi7FjbG/8RxcZJKDAKB85FRJ2XlFrQrS Nmr+kZXssjcXj46y8B7ssFPSFXjy+p7ZLT5m1QkoZxs8mvmQZgOjrtCYjMXChlpDS8 QIsK3i8RfsEo4daXbDRNVRDsWwS3msS1kY5Lk0Oa4LfTWVyb3+70Zc5v0SpGQijKi9 s1V9tlQQc8LR5JCxjPODFlTjmI/zsrnvfWETPRF9xO5jf8kXptJz1gAldw2YbR4+/j 0U1+njnMC3GkQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 4/6] kconfig: gconf: remove unnecessary forward declarations Date: Sun, 2 Jun 2024 03:20:41 +0900 Message-Id: <20240601182043.876249-4-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240601182043.876249-1-masahiroy@kernel.org> References: <20240601182043.876249-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 These are defined before their call sites. Signed-off-by: Masahiro Yamada --- scripts/kconfig/gconf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index e04dbafd3add..3dc459d9840c 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -65,8 +65,6 @@ static void display_list(void); static void display_tree(struct menu *menu); static void display_tree_part(void); static void update_tree(struct menu *src, GtkTreeIter * dst); -static void set_node(GtkTreeIter * node, struct menu *menu, gchar ** row); -static gchar **fill_row(struct menu *menu); static void conf_changed(void); static void replace_button_icon(GladeXML *xml, GdkDrawable *window, From patchwork Sat Jun 1 18:20:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13682537 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 BF698155327; Sat, 1 Jun 2024 18:20:54 +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=1717266054; cv=none; b=g6Z+N83wGDIk38IDf/6TbUsXFR6g7LXaCBR5xBvoR9uZmZlGKFdI8YHPU6z3/FE7Y0wc8HyOYE8aaC3Q4h2qEx2DZJWS1dytctm8PBcJSkxe5aDVzvWLGOcrsw1rDroElP4lPb0eSVKZRvB1i8r8pdshXsY5QE6XmIPXtt+8e+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717266054; c=relaxed/simple; bh=mO0aels7OLVhPoOj+vZK1tWzWjD3YuYz/mu5G7G94go=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oexVnuB/NXrGJzGzaS88hPQlJC1OlHGj85460r71veQQxMMs0pfNR3S5QJxKsuRVMrKslRCBex7tR4POxm0e+nMYB6CpsWg8oToyO3ptt0n+BQgjuAXXfsdMCyL8ZXmc3L8ZaeV7QoPPPiVaXhEFwEMwFYFIwp60y9t/kdvSUPc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H28dpMds; 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="H28dpMds" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C9D1C32789; Sat, 1 Jun 2024 18:20:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717266054; bh=mO0aels7OLVhPoOj+vZK1tWzWjD3YuYz/mu5G7G94go=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H28dpMdsv+2tlK0TdruUkMCkE/pCswQJqGO+jUgzwyEdQXKUSeP94GzNr3YiW/QJr zmGa918tH0FJjx4vseXK2V/1CLqD9+prDAoFCkSvWhbU+btq+CLjlZFv1Zw/xYA0gS CuaE2WCT7FpcwMOWun7InmRo84qv+fjZqWiXcu0wPfCjDU/A+g/LOzlYRU86AZlwld bj68tfU5X7Cb+OBjeHI3AQmyNBRieDIQ4S4MQv9ZURXI/X3BWsXfL+Vpo3LGiDDXy2 jamskemw/jhT1CfQa9Mc7+yCo+oSysn3sQmPFTE69Qqr/7ax/q4puerC0jgvAE3gGY 3F9qgc6kW5QFQ== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 5/6] kconfig: gconf: move conf_changed() definition up Date: Sun, 2 Jun 2024 03:20:42 +0900 Message-Id: <20240601182043.876249-5-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240601182043.876249-1-masahiroy@kernel.org> References: <20240601182043.876249-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Define conf_changed() before its call site to remove the forward declaration. Signed-off-by: Masahiro Yamada --- scripts/kconfig/gconf.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 3dc459d9840c..2bf74aee5eff 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -65,7 +65,6 @@ static void display_list(void); static void display_tree(struct menu *menu); static void display_tree_part(void); static void update_tree(struct menu *src, GtkTreeIter * dst); -static void conf_changed(void); static void replace_button_icon(GladeXML *xml, GdkDrawable *window, GtkStyle *style, gchar *btn_name, gchar **xpm) @@ -85,6 +84,13 @@ static void replace_button_icon(GladeXML *xml, GdkDrawable *window, gtk_tool_button_set_icon_widget(button, image); } +static void conf_changed(void) +{ + bool changed = conf_get_changed(); + gtk_widget_set_sensitive(save_btn, changed); + gtk_widget_set_sensitive(save_menu_item, changed); +} + /* Main Window Initialization */ static void init_main_window(const gchar *glade_file) { @@ -1445,10 +1451,3 @@ int main(int ac, char *av[]) return 0; } - -static void conf_changed(void) -{ - bool changed = conf_get_changed(); - gtk_widget_set_sensitive(save_btn, changed); - gtk_widget_set_sensitive(save_menu_item, changed); -} From patchwork Sat Jun 1 18:20:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13682538 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 EF8D0155348; Sat, 1 Jun 2024 18:20:55 +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=1717266056; cv=none; b=JkQI2ePfECe27eo4d4GJrNIQiXPHJ6FDPEoUa4g5w/edZbjaO/XZV0IOLN56R/0Lc7NIEezYT3ZaR/aEAac28mDPWXaDO0Sf4z145mB+9YnKtb9OLN7cqx/zzpm07Qb6jZxziVjFw4O/B+/5wNVCuiZ1V3sFgVZYSg8G7pCoAkY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717266056; c=relaxed/simple; bh=kC1jc3prKdtA/LgosSTF/JuJoDdO9UUh+Y3Hw0pC3Mo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GXvcJKSrkkTSK8VdmsjplhE2MtHTD8/XAFP5hBVRYnhpk6f9PdV5KmGQhzLCEXh3V/UFXcyFO9+PjHtDJohWP+APzAv5Ey8aMAJMULz28ebMLs3Xfna8WHgFYL/EQvkW6acJJ2+st1X4Ooun5zqIAiuMaxuVbfjjiuvqXz9hHeU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Vg67uHb3; 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="Vg67uHb3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C15CCC4AF08; Sat, 1 Jun 2024 18:20:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717266055; bh=kC1jc3prKdtA/LgosSTF/JuJoDdO9UUh+Y3Hw0pC3Mo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vg67uHb3e6ApuZockC+sUyc0WOdFnzWF6d78gAUgF/OOw41DV5Eyp6u+D3TBz5D1b mbgRd8u5HBT5Zue98gtwIxiRXKBNfOqc7Pn3Yz5KDRd16DnHszHRBGaB2atOAqm17W InU/3k5RvsYQ+8zCjpQ8Oo+AUmCKmF7H48eIpVzfNxuq31AB6wxLPok1eSnl+FpvWe 3uHsDfAtME7WqmqEBaw5paw+JJhpO7lMsyZpCzGY5d6gNycoRFFGzYeNv+BuWOVYhm RayQCs0a3ro20wlofLJI4+bbYhXY5qvuDh0dOC1WE1ZOarpfWWnUTLKdLxTJ1RJdmU spT/rZ/46KKUw== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 6/6] kconfig: pass new the conf_changed value to the callback Date: Sun, 2 Jun 2024 03:20:43 +0900 Message-Id: <20240601182043.876249-6-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240601182043.876249-1-masahiroy@kernel.org> References: <20240601182043.876249-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Commit ee06a3ef7e3c ("kconfig: Update config changed flag before calling callback") pointed out that conf_updated flag must be updated before calling the callback because it needs to know the new value. If so, it makes sense to pass the new value to the callback. Signed-off-by: Masahiro Yamada --- scripts/kconfig/confdata.c | 10 ++++------ scripts/kconfig/gconf.c | 7 +++---- scripts/kconfig/lkc_proto.h | 2 +- scripts/kconfig/qconf.cc | 4 ++-- scripts/kconfig/qconf.h | 2 +- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 85b53069ba7a..946185506380 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -1141,16 +1141,14 @@ int conf_write_autoconf(int overwrite) } static bool conf_changed; -static void (*conf_changed_callback)(void); +static void (*conf_changed_callback)(bool); void conf_set_changed(bool val) { - bool changed = conf_changed != val; + if (conf_changed_callback && conf_changed != val) + conf_changed_callback(val); conf_changed = val; - - if (conf_changed_callback && changed) - conf_changed_callback(); } bool conf_get_changed(void) @@ -1158,7 +1156,7 @@ bool conf_get_changed(void) return conf_changed; } -void conf_set_changed_callback(void (*fn)(void)) +void conf_set_changed_callback(void (*fn)(bool)) { conf_changed_callback = fn; } diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 2bf74aee5eff..baa1c512de3c 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -84,11 +84,10 @@ static void replace_button_icon(GladeXML *xml, GdkDrawable *window, gtk_tool_button_set_icon_widget(button, image); } -static void conf_changed(void) +static void conf_changed(bool dirty) { - bool changed = conf_get_changed(); - gtk_widget_set_sensitive(save_btn, changed); - gtk_widget_set_sensitive(save_menu_item, changed); + gtk_widget_set_sensitive(save_btn, dirty); + gtk_widget_set_sensitive(save_menu_item, dirty); } /* Main Window Initialization */ diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index d76aaf4ea117..c663fd8b35d2 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h @@ -13,7 +13,7 @@ int conf_write(const char *name); int conf_write_autoconf(int overwrite); void conf_set_changed(bool val); bool conf_get_changed(void); -void conf_set_changed_callback(void (*fn)(void)); +void conf_set_changed_callback(void (*fn)(bool)); void conf_set_message_callback(void (*fn)(const char *s)); bool conf_errors(void); diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index e62e862ea283..03fa096074b4 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1849,10 +1849,10 @@ void ConfigMainWindow::saveSettings(void) configSettings->writeSizes("/split2", split2->sizes()); } -void ConfigMainWindow::conf_changed(void) +void ConfigMainWindow::conf_changed(bool dirty) { if (saveAction) - saveAction->setEnabled(conf_get_changed()); + saveAction->setEnabled(dirty); } void fixup_rootmenu(struct menu *menu) diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index 78b0a1dfcd53..53373064d90a 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h @@ -239,7 +239,7 @@ class ConfigMainWindow : public QMainWindow { char *configname; static QAction *saveAction; - static void conf_changed(void); + static void conf_changed(bool); public: ConfigMainWindow(void); public slots: