mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: rafael.j.wysocki@intel.com
Cc: ggherdovich@suse.cz, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: [PATCH 1/2] ACPI: processor: idle: Set pr->flags.power unconditionally
Date: Wed,  9 Apr 2025 08:50:25 +0800	[thread overview]
Message-ID: <20250409005026.1932637-2-rui.zhang@intel.com> (raw)
In-Reply-To: <20250409005026.1932637-1-rui.zhang@intel.com>

acpi_processor_get_power_info_default() ensures that the processor's
ACPI_STATE_C1 state is always valid. Consequently, the pr->flags.power
should be set unconditionally after this.

Remove conditional checks and directly set pr->flags.power.

No functional change.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/acpi/processor_idle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 2a076c7a825a..7264444d56b8 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -481,11 +481,11 @@ static int acpi_processor_get_cstate_info(struct acpi_processor *pr)
 	acpi_processor_get_power_info_default(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;
-			pr->flags.power = 1;
 		}
 	}
 
-- 
2.43.0


  reply	other threads:[~2025-04-09  0:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09  0:50 [PATCH 0/2] ACPI: processor: idle: acpi_processor_get_cstate_info() cleanup Zhang Rui
2025-04-09  0:50 ` Zhang Rui [this message]
2025-04-09  0:50 ` [PATCH 2/2] ACPI: processor: idle: Remove redundant pr->power.count assignment Zhang Rui
2025-04-17  7:37 ` [PATCH 0/2] ACPI: processor: idle: acpi_processor_get_cstate_info() cleanup Giovanni Gherdovich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250409005026.1932637-2-rui.zhang@intel.com \
    --to=rui.zhang@intel.com \
    --cc=ggherdovich@suse.cz \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®