From febae602a541e9ee59fe6b818c0fac700fe5ec50 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Wed, 6 May 2026 10:00:00 -0400 Subject: [PATCH] x86_energy_perf_policy: Cleanup: Constify read only parameters Add const qualifiers to the parameters of parse_optarg_string(), platform_profile_name_is(), print_hwp_request(), and print_hwp_request_pkg() which are read-only. Assisted-by: GitHub-Copilot:Claude-Sonnet-4.6 Reviewed-by: Andy Shevchenko Signed-off-by: Len Brown --- .../x86/x86_energy_perf_policy/x86_energy_perf_policy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c index 70b1d0fcd067..b1754070f095 100644 --- a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c +++ b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c @@ -345,7 +345,7 @@ int parse_cmdline_turbo(int i) return i; } -long parse_optarg_string(char *s) +long parse_optarg_string(const char *s) { long i; char *endptr; @@ -586,7 +586,7 @@ static int platform_profile_access(int mode) return 1; } -static int platform_profile_name_is(char *name) +static int platform_profile_name_is(const char *name) { char buf[64]; @@ -968,7 +968,7 @@ void read_hwp_cap(int cpu, struct msr_hwp_cap *cap, unsigned int msr_offset) cap->lowest = msr_perf_2_ratio(HWP_LOWEST_PERF(msr)); } -void print_hwp_request(int cpu, struct msr_hwp_request *h, char *str) +void print_hwp_request(int cpu, struct msr_hwp_request *h, const char *str) { if (cpu != -1) printf("cpu%d: ", cpu); @@ -980,7 +980,7 @@ void print_hwp_request(int cpu, struct msr_hwp_request *h, char *str) h->hwp_min, h->hwp_max, h->hwp_desired, h->hwp_epp, h->hwp_window, h->hwp_window & 0x7F, (h->hwp_window >> 7) & 0x7, h->hwp_use_pkg); } -void print_hwp_request_pkg(int pkg, struct msr_hwp_request *h, char *str) +void print_hwp_request_pkg(int pkg, struct msr_hwp_request *h, const char *str) { printf("pkg%d: ", pkg);