From: Li Wang <wangli.ahau@gmail.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] lib/tst_kconfig: rename runtime_check to config_runtime_map
Date: Tue, 21 Apr 2026 21:07:06 +0800 [thread overview]
Message-ID: <20260421130706.14254-1-wangli.ahau@gmail.com> (raw)
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
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next reply other threads:[~2026-04-21 13:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 13:07 Li Wang [this message]
2026-04-21 13:29 ` [LTP] lib/tst_kconfig: rename runtime_check to config_runtime_map linuxtestproject.agent
2026-04-21 14:27 ` [LTP] [PATCH] " Cyril Hrubis
2026-04-22 2:31 ` Li Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260421130706.14254-1-wangli.ahau@gmail.com \
--to=wangli.ahau@gmail.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox