* [PATCH] kconfig: Update config changed flag before calling callback
@ 2023-03-07 19:40 Jurica Vukadin
2023-03-13 3:15 ` Randy Dunlap
2023-03-13 18:47 ` Masahiro Yamada
0 siblings, 2 replies; 3+ messages in thread
From: Jurica Vukadin @ 2023-03-07 19:40 UTC (permalink / raw)
To: Masahiro Yamada; +Cc: linux-kbuild, linux-kernel, Jurica Vukadin
Prior to commit 5ee546594025 ("kconfig: change sym_change_count to a
boolean flag"), the conf_updated flag was set to the new value *before*
calling the callback. xconfig's save action depends on this behaviour,
because xconfig calls conf_get_changed() directly from the callback and
now sees the old value, thus never enabling the save button or the
shortcut.
Restore the previous behaviour.
Fixes: 5ee546594025 ("kconfig: change sym_change_count to a boolean flag")
Signed-off-by: Jurica Vukadin <jura@vukad.in>
---
scripts/kconfig/confdata.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index b7c9f1dd5e42..992575f1e976 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -1226,10 +1226,12 @@ static void (*conf_changed_callback)(void);
void conf_set_changed(bool val)
{
- if (conf_changed_callback && conf_changed != val)
- conf_changed_callback();
+ bool changed = conf_changed != val;
conf_changed = val;
+
+ if (conf_changed_callback && changed)
+ conf_changed_callback();
}
bool conf_get_changed(void)
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] kconfig: Update config changed flag before calling callback
2023-03-07 19:40 [PATCH] kconfig: Update config changed flag before calling callback Jurica Vukadin
@ 2023-03-13 3:15 ` Randy Dunlap
2023-03-13 18:47 ` Masahiro Yamada
1 sibling, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2023-03-13 3:15 UTC (permalink / raw)
To: Jurica Vukadin, Masahiro Yamada; +Cc: linux-kbuild, linux-kernel
Hi--
On 3/7/23 11:40, Jurica Vukadin wrote:
> Prior to commit 5ee546594025 ("kconfig: change sym_change_count to a
> boolean flag"), the conf_updated flag was set to the new value *before*
> calling the callback. xconfig's save action depends on this behaviour,
> because xconfig calls conf_get_changed() directly from the callback and
> now sees the old value, thus never enabling the save button or the
> shortcut.
>
> Restore the previous behaviour.
>
> Fixes: 5ee546594025 ("kconfig: change sym_change_count to a boolean flag")
> Signed-off-by: Jurica Vukadin <jura@vukad.in>
Thanks! I was wondering what had happened to that, but I never
got around to bisecting it.
Now the Disk icon is live instead of being greyed out after
a change is made.
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
> ---
> scripts/kconfig/confdata.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
> index b7c9f1dd5e42..992575f1e976 100644
> --- a/scripts/kconfig/confdata.c
> +++ b/scripts/kconfig/confdata.c
> @@ -1226,10 +1226,12 @@ static void (*conf_changed_callback)(void);
>
> void conf_set_changed(bool val)
> {
> - if (conf_changed_callback && conf_changed != val)
> - conf_changed_callback();
> + bool changed = conf_changed != val;
>
> conf_changed = val;
> +
> + if (conf_changed_callback && changed)
> + conf_changed_callback();
> }
>
> bool conf_get_changed(void)
--
~Randy
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] kconfig: Update config changed flag before calling callback
2023-03-07 19:40 [PATCH] kconfig: Update config changed flag before calling callback Jurica Vukadin
2023-03-13 3:15 ` Randy Dunlap
@ 2023-03-13 18:47 ` Masahiro Yamada
1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2023-03-13 18:47 UTC (permalink / raw)
To: Jurica Vukadin; +Cc: linux-kbuild, linux-kernel
On Wed, Mar 8, 2023 at 4:40 AM Jurica Vukadin <jura@vukad.in> wrote:
>
> Prior to commit 5ee546594025 ("kconfig: change sym_change_count to a
> boolean flag"), the conf_updated flag was set to the new value *before*
> calling the callback. xconfig's save action depends on this behaviour,
> because xconfig calls conf_get_changed() directly from the callback and
> now sees the old value, thus never enabling the save button or the
> shortcut.
>
> Restore the previous behaviour.
>
> Fixes: 5ee546594025 ("kconfig: change sym_change_count to a boolean flag")
> Signed-off-by: Jurica Vukadin <jura@vukad.in>
Applied to linux-kbuild.
Thanks.
> ---
> scripts/kconfig/confdata.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
> index b7c9f1dd5e42..992575f1e976 100644
> --- a/scripts/kconfig/confdata.c
> +++ b/scripts/kconfig/confdata.c
> @@ -1226,10 +1226,12 @@ static void (*conf_changed_callback)(void);
>
> void conf_set_changed(bool val)
> {
> - if (conf_changed_callback && conf_changed != val)
> - conf_changed_callback();
> + bool changed = conf_changed != val;
>
> conf_changed = val;
> +
> + if (conf_changed_callback && changed)
> + conf_changed_callback();
> }
>
> bool conf_get_changed(void)
> --
> 2.39.2
>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-13 18:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07 19:40 [PATCH] kconfig: Update config changed flag before calling callback Jurica Vukadin
2023-03-13 3:15 ` Randy Dunlap
2023-03-13 18:47 ` Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).