[LTP] [PATCH] lib/tst_kconfig: rename runtime_check to config_runtime_map
Li Wang
wangli.ahau@gmail.com
Tue Apr 21 15:07:06 CEST 2026
Rename struct 'runtime_check' to 'config_runtime_map' and
array 'runtime_checks' to 'config_runtime_maps' to better
reflect their purpose of mapping kconfig options to runtime
checks.
Rename function runtime_check to kconfig_runtime_check for
consistency with kconfig_module_check().
Follow-up: d7d6512e89 ("lib: tst_kconfig: Add module presence checks")
Signed-off-by: Li Wang <wangli.ahau@gmail.com>
---
Notes:
Hi Cyril,
It seems you forgot to add this modification at the top of
the patchset. So I made it for the name consistency.
lib/tst_kconfig.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
index f4d4a8679..44eacc7c2 100644
--- a/lib/tst_kconfig.c
+++ b/lib/tst_kconfig.c
@@ -112,10 +112,10 @@ static void close_kconfig(FILE *fp)
fclose(fp);
}
-static struct runtime_check {
+static struct config_runtime_map {
const char *config;
bool (*runtime_check)(void);
-} runtime_checks[] = {
+} config_runtime_maps[] = {
{"CONFIG_USER_NS", tst_user_ns_enabled},
{"CONFIG_NET_NS", tst_net_ns_enabled},
{"CONFIG_PID_NS", tst_pid_ns_enabled},
@@ -124,17 +124,17 @@ static struct runtime_check {
{}
};
-static void runtime_check(struct tst_kconfig_var *var)
+static void kconfig_runtime_check(struct tst_kconfig_var *var)
{
size_t i;
- for (i = 0; runtime_checks[i].config; i++) {
- if (strcmp(runtime_checks[i].config, var->id))
+ for (i = 0; config_runtime_maps[i].config; i++) {
+ if (strcmp(config_runtime_maps[i].config, var->id))
continue;
tst_res(TDEBUG, "Running runtime check for '%s'", var->id);
- if (!runtime_checks[i].runtime_check()) {
+ if (!config_runtime_maps[i].runtime_check()) {
tst_res(TINFO,
"%s=%c present but disabled at runtime",
var->id, var->choice);
@@ -257,11 +257,11 @@ out:
switch (val[0]) {
case 'y':
vars[i].choice = 'y';
- runtime_check(&vars[i]);
+ kconfig_runtime_check(&vars[i]);
return 1;
case 'm':
vars[i].choice = 'm';
- runtime_check(&vars[i]);
+ kconfig_runtime_check(&vars[i]);
kconfig_module_check(&vars[i]);
return 1;
}
--
2.53.0
More information about the ltp
mailing list