summaryrefslogtreecommitdiff
path: root/scripts/kconfig/confdata.c
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2024-06-02 03:20:43 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2024-07-16 01:08:36 +0900
commit03638aaa7995c07376f2e51ac2640ccd25b4ba75 (patch)
tree462c097dff79126730203c9835c43e930ff6821a /scripts/kconfig/confdata.c
parent0b62fe46d77878645d117e70b9f135d7c9fcab47 (diff)
kconfig: pass new conf_changed value to the callback
Commit ee06a3ef7e3c ("kconfig: Update config changed flag before calling callback") pointed out that conf_updated flag must be updated _before_ calling the callback, which needs to know the new value. Given that, it makes sense to directly pass the new value to the callback. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/kconfig/confdata.c')
-rw-r--r--scripts/kconfig/confdata.c10
1 files changed, 4 insertions, 6 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;
}