Skip to contentSkip to conversation

tools/power x86_energy_perf_policy: Fix format string in error message

PATCH New Malaya Kumar Rout 1 participant 1 message Nov 22, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/power x86_energy_perf_policy: Fix format string in error message

The error message in validate_cpu_selected_set() uses an incomplete format specifier "cpu%" instead of "cpu%d", resulting in the error message printing "Requested cpu% is not present" rather than showing the actual CPU number.

Fix the format string to properly display the CPU number.

---
 tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c +1 -1
index 884a4c746f32..3e002f0bd65c 100644
@@ -370,7 +370,7 @@ void validate_cpu_selected_set(void)
 	for (cpu = 0; cpu <= max_cpu_num; ++cpu) {
 		if (CPU_ISSET_S(cpu, cpu_setsize, cpu_selected_set))
 			if (!CPU_ISSET_S(cpu, cpu_setsize, cpu_present_set))
-				errx(1, "Requested cpu% is not present", cpu);
+				errx(1, "Requested cpu%d is not present", cpu);
 	}
 }
 
Signature · 1 line
2.51.0