diff options
author | Zihuan Zhang <zhangzihuan@kylinos.cn> | 2025-08-22 10:04:23 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-08-22 22:33:22 +0300 |
commit | e9e124501f0d7ea2caea94711efe50fe081a11ea (patch) | |
tree | 25a9fc1c6ca2f127492a41bb343beda87063442a /tools/testing/selftests/bpf/prog_tests/autoload.c | |
parent | c5746dc1898a1bd5518a03081dc7e380569e269d (diff) | |
download | linux-e9e124501f0d7ea2caea94711efe50fe081a11ea.tar.xz |
cpufreq: use strlen() for governor name comparison
Most kernel code using strncasecmp()/strncmp() passes strlen("xxx")
as the length argument. cpufreq_parse_policy() previously used
CPUFREQ_NAME_LEN (16), which is longer than the actual strings
("performance" is 11 chars, "powersave" is 9 chars).
This patch switches to strlen() for the comparison, making the
matching slightly more permissive (e.g., "powersavexxx" will now
also match "powersave"). While this is unlikely to cause functional
issues, it aligns cpufreq with common kernel style and makes the
behavior more intuitive.
Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://patch.msgid.link/20250822070424.166795-2-zhangzihuan@kylinos.cn
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions