[LTP] [PATCH v4] device-drivers/cpufreq_boost: Don't hardcode to CPU0

Cyril Hrubis chrubis@suse.cz
Fri Jul 25 14:31:02 CEST 2025


Hi!
> -const char governor[]	= SYSFS_CPU_DIR "cpu0/cpufreq/scaling_governor";
> +static int cpu;
> +
> +static const char _governor[] = SYSFS_CPU_DIR "cpu%d/cpufreq/scaling_governor";

Identifiers starting with underscore are reserved for kernel/libc
implementation we shouldn't use them here. I guess that this would be
better as governor_fmt.

> +static char governor[64];
>  static char governor_name[16];
>  
> -const char maxspeed[]	= SYSFS_CPU_DIR "cpu0/cpufreq/scaling_max_freq";
> +static const char _maxspeed[] = SYSFS_CPU_DIR "cpu%d/cpufreq/scaling_max_freq";

Here as well.


Other than that it looks fine. I can push the patch with the change from
_governor to governor_fmt and _maxspeed to maxspeed_fmt if you agree.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list