public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] lib/tst_kconfig: rename runtime_check to config_runtime_map
@ 2026-04-21 13:07 Li Wang
  2026-04-21 13:29 ` [LTP] " linuxtestproject.agent
  2026-04-21 14:27 ` [LTP] [PATCH] " Cyril Hrubis
  0 siblings, 2 replies; 4+ messages in thread
From: Li Wang @ 2026-04-21 13:07 UTC (permalink / raw)
  To: ltp

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-04-22  2:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-21 13:07 [LTP] [PATCH] lib/tst_kconfig: rename runtime_check to config_runtime_map Li Wang
2026-04-21 13:29 ` [LTP] " linuxtestproject.agent
2026-04-21 14:27 ` [LTP] [PATCH] " Cyril Hrubis
2026-04-22  2:31   ` Li Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox