[LTP] [PATCH v7] high_freq_hwp_cap_cppc.c: new test

Andrea Cervesato andrea.cervesato@suse.com
Wed Apr 29 09:53:13 CEST 2026


Hi Piotr,

I commented the wrong patch. Was v6, sorry. Let me complete the review
here.

> +static void run(void)
> +{
> +	bool status = true;
> +
> +	for (int i = 0; i < nproc; i++) {
> +		int online = 1;
> +		char path[PATH_MAX];

This can stay out of the loop. `snprintf()` adds a string terminator
so there's no issue with this.

> +		unsigned long long msr_highest_perf = 0, sysfs_highest_perf = 0;
> +
> +		snprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu%d/online", i);
> +		if (i)

I think I missed a part here. Did you double check if `i == 0` creates
an issue while using SAFE_FILE_SCANF ? Please verify and eventually
remove this check.

> +			SAFE_FILE_SCANF(path, "%d", &online);

Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com


More information about the ltp mailing list