[LTP] [PATCH] starvation: honor -t instead of calibrating

Victor Cheng-Yen Yang cyyang772@andestech.com
Fri Aug 21 07:53:41 CEST 2026


tst_parse_int() returns 0 both when the option is absent and when it
parses successfully, so its return value cannot distinguish the two.

Use the zero-initialized timeout as the "not set" sentinel and skip
calibration entirely when -t is supplied correctly.

Signed-off-by: Victor Cheng-Yen Yang <cyyang772@andestech.com>
---
 testcases/kernel/sched/cfs-scheduler/starvation.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/sched/cfs-scheduler/starvation.c b/testcases/kernel/sched/cfs-scheduler/starvation.c
index 045254ba4..ff041bdcd 100644
--- a/testcases/kernel/sched/cfs-scheduler/starvation.c
+++ b/testcases/kernel/sched/cfs-scheduler/starvation.c
@@ -107,7 +107,8 @@ static void setup(void)
 
 	if (tst_parse_int(str_timeout, &timeout, 1, INT_MAX))
 		tst_brk(TBROK, "Invalid number of timeout '%s'", str_timeout);
-	else
+
+	if (!timeout)
 		timeout = callibrate() / 1000;
 
 	if (tst_has_slow_kconfig())
-- 
2.34.1



More information about the ltp mailing list