Skip to content

Commit

Permalink
kconfig: Update config changed flag before calling callback
Browse files Browse the repository at this point in the history
[ Upstream commit ee06a3e ]

Prior to commit 5ee5465 ("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: 5ee5465 ("kconfig: change sym_change_count to a boolean flag")
Signed-off-by: Jurica Vukadin <[email protected]>
Acked-by: Randy Dunlap <[email protected]>
Tested-by: Randy Dunlap <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
u-ra authored and gregkh committed Mar 22, 2023
1 parent 52f64c5 commit c80b2ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,10 +1124,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)
Expand Down

0 comments on commit c80b2ac

Please sign in to comment.