[22.11] power: fix log message when checking lcore ID

David Marchand david.marchand at redhat.com
Mon Dec 9 15:01:42 CET 2024


Caught while inspecting changes backported in 22.11 LTS branch.
The POWER_LOG() macro in the main branch automatically appends a \n
which is not done by RTE_LOG().

Fixes: a73f3a97ff25 ("power: fix mapped lcore ID")

Signed-off-by: David Marchand <david.marchand at redhat.com>
---
 lib/power/power_acpi_cpufreq.c   | 2 +-
 lib/power/power_common.c         | 2 +-
 lib/power/power_cppc_cpufreq.c   | 2 +-
 lib/power/power_pstate_cpufreq.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/power/power_acpi_cpufreq.c b/lib/power/power_acpi_cpufreq.c
index 8068c6d98b..0937cddba2 100644
--- a/lib/power/power_acpi_cpufreq.c
+++ b/lib/power/power_acpi_cpufreq.c
@@ -258,7 +258,7 @@ power_acpi_cpufreq_init(unsigned int lcore_id)
 	}
 
 	if (power_get_lcore_mapped_cpu_id(lcore_id, &pi->lcore_id) < 0) {
-		RTE_LOG(ERR, POWER, "Cannot get CPU ID mapped for lcore %u", lcore_id);
+		RTE_LOG(ERR, POWER, "Cannot get CPU ID mapped for lcore %u\n", lcore_id);
 		return -1;
 	}
 
diff --git a/lib/power/power_common.c b/lib/power/power_common.c
index e2a8c33604..6e68a8f6d5 100644
--- a/lib/power/power_common.c
+++ b/lib/power/power_common.c
@@ -212,7 +212,7 @@ int power_get_lcore_mapped_cpu_id(uint32_t lcore_id, uint32_t *cpu_id)
 	lcore_cpus = rte_lcore_cpuset(lcore_id);
 	if (CPU_COUNT(&lcore_cpus) != 1) {
 		RTE_LOG(ERR, POWER,
-			"Power library does not support lcore %u mapping to %u CPUs",
+			"Power library does not support lcore %u mapping to %u CPUs\n",
 			lcore_id, CPU_COUNT(&lcore_cpus));
 		return -1;
 	}
diff --git a/lib/power/power_cppc_cpufreq.c b/lib/power/power_cppc_cpufreq.c
index 9a77811087..83b30d366e 100644
--- a/lib/power/power_cppc_cpufreq.c
+++ b/lib/power/power_cppc_cpufreq.c
@@ -362,7 +362,7 @@ power_cppc_cpufreq_init(unsigned int lcore_id)
 	}
 
 	if (power_get_lcore_mapped_cpu_id(lcore_id, &pi->lcore_id) < 0) {
-		RTE_LOG(ERR, POWER, "Cannot get CPU ID mapped for lcore %u", lcore_id);
+		RTE_LOG(ERR, POWER, "Cannot get CPU ID mapped for lcore %u\n", lcore_id);
 		return -1;
 	}
 
diff --git a/lib/power/power_pstate_cpufreq.c b/lib/power/power_pstate_cpufreq.c
index baa1835fbc..5799102c2b 100644
--- a/lib/power/power_pstate_cpufreq.c
+++ b/lib/power/power_pstate_cpufreq.c
@@ -564,7 +564,7 @@ power_pstate_cpufreq_init(unsigned int lcore_id)
 	}
 
 	if (power_get_lcore_mapped_cpu_id(lcore_id, &pi->lcore_id) < 0) {
-		RTE_LOG(ERR, POWER, "Cannot get CPU ID mapped for lcore %u", lcore_id);
+		RTE_LOG(ERR, POWER, "Cannot get CPU ID mapped for lcore %u\n", lcore_id);
 		return -1;
 	}
 
-- 
2.47.0



More information about the stable mailing list