From: Jurica Vukadin Date: Tue, 7 Mar 2023 19:40:39 +0000 (+0100) Subject: kconfig: Update config changed flag before calling callback X-Git-Tag: baikal/mips/sdk6.1~104 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=0bfb01046f10e87f169718a45054f5b7b7be7b6c;p=kernel.git kconfig: Update config changed flag before calling callback [ Upstream commit 86c3e3bacef8ea8852914a05089b98613fe9e8d3 ] Prior to commit 8d17b7d0d7fa ("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: 8d17b7d0d7fa ("kconfig: change sym_change_count to a boolean flag") Signed-off-by: Jurica Vukadin Acked-by: Randy Dunlap Tested-by: Randy Dunlap Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index b7c9f1dd5e422..992575f1e9769 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)