From: Zhang Rui Date: Wed, 9 Apr 2025 00:50:26 +0000 (+0800) Subject: ACPI: processor: idle: Remove redundant pr->power.count assignment X-Git-Tag: v6.16-rc1~161^2~2^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0edd1d13de5eb325dd9a6b39fccfc52d022effe2;p=thirdparty%2Flinux.git 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 --- 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; }