From 0edd1d13de5eb325dd9a6b39fccfc52d022effe2 Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Wed, 9 Apr 2025 08:50:26 +0800 Subject: [PATCH] ACPI: processor: idle: Remove redundant pr->power.count assignment pr->power.count stands for the number of valid processor cstates. And it is correctly set with the return value of acpi_processor_power_verify(), in acpi_processor_get_cstate_info(). Remove the redundant logic that unnecessarily overrides pr->power.count value. No functional change intended. Signed-off-by: Zhang Rui Link: https://patch.msgid.link/20250409005026.1932637-3-rui.zhang@intel.com [ rjw: Removed unused variable, fixed up white space ] Signed-off-by: Rafael J. Wysocki --- drivers/acpi/processor_idle.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 7264444d56b86..e2febca2ec13e 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -461,10 +461,8 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) static int acpi_processor_get_cstate_info(struct acpi_processor *pr) { - unsigned int i; int result; - /* NOTE: the idle thread may not be running while calling * this function */ @@ -483,12 +481,6 @@ static int acpi_processor_get_cstate_info(struct acpi_processor *pr) pr->power.count = acpi_processor_power_verify(pr); pr->flags.power = 1; - for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { - if (pr->power.states[i].valid) { - pr->power.count = i; - } - } - return 0; } -- 2.39.5