Linux ACPI
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Linux PM <linux-pm@vger.kernel.org>,
	Sudeep Holla <sudeep.holla@kernel.org>,
	Linux ACPI <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH v1 11/17] ACPI: processor: idle: Rework flatten_lpi_states()
Date: Mon, 13 Jul 2026 14:23:14 +0100	[thread overview]
Message-ID: <20260713-tall-precise-whale-93edc7@sudeepholla> (raw)
In-Reply-To: <2064627.usQuhbGJ8B@rafael.j.wysocki>

On Thu, Jul 09, 2026 at 02:39:06PM +0200, Rafael J. Wysocki wrote:
> From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> 
> Rewrite flatten_lpi_states() to make it easier to follow:
> 
>  * Rename its flat_state_cnt, curr_level and prev_level parameters to
>    state_count, curr, and prev, respectively, so their names match the
>    names of analogous variables in acpi_processor_get_lpi_info().
> 
>  * Eliminate a redundant local variable state_count.
> 
>  * Move definitions of local variables to the code blocks in which
>    they are used.
> 
>  * Reduce the indentation level in the inner loop.
> 
>  * Use more meaningful names for local variables.
> 
>  * Move two statements that belong in acpi_processor_get_lpi_info()
>    from flatten_lpi_states() to that function.
> 
>  * Use acpi_handle_info() for printing a message when the count of
>    flattened states gets too large and drop the message requesting
>    ACPI_PROCESSOR_MAX_POWER to be adjusted which is pointless.
> 
>  * Add a comment explaining what happens in that function.
> 

Nice refactoring, thanks for doing this. It is much simpler to follow.

> No intentional functional impact beyond the message printed when
> the count of flattened states is too large.
> 

Reviewed-by: Sudeep Holla <sudeep.holla@kernel.org>

-- 
Regards,
Sudeep

  reply	other threads:[~2026-07-13 13:23 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 12:29 [PATCH v1 00/17] ACPI: processor: idle/intel_idle: Add ACPI _LPI support to intel_idle Rafael J. Wysocki
2026-07-09 12:30 ` [PATCH v1 01/17] ACPI: processor: idle: Expand _LPI package sanity checks Rafael J. Wysocki
2026-07-13 11:22   ` Sudeep Holla
2026-07-09 12:31 ` [PATCH v1 02/17] ACPI: processor: idle: Ignore _LPI states with SYSTEMIO entry method Rafael J. Wysocki
2026-07-13 11:24   ` Sudeep Holla
2026-07-09 12:32 ` [PATCH v1 03/17] ACPI: processor: idle: Unify debug in acpi_processor_evaluate_lpi() Rafael J. Wysocki
2026-07-13 11:27   ` Sudeep Holla
2026-07-09 12:33 ` [PATCH v1 04/17] ACPI: processor: idle: Rearrange acpi_processor_evaluate_lpi() Rafael J. Wysocki
2026-07-13 11:29   ` Sudeep Holla
2026-07-09 12:34 ` [PATCH v1 05/17] ACPI: processor: idle: Split acpi_processor_evaluate_lpi() Rafael J. Wysocki
2026-07-13 13:17   ` Sudeep Holla
2026-07-09 12:35 ` [PATCH v1 06/17] ACPI: processor: idle: Introduce lpi_state_debug() Rafael J. Wysocki
2026-07-09 12:36 ` [PATCH v1 07/17] ACPI: processor: idle: Rearrange acpi_processor_get_lpi_info() Rafael J. Wysocki
2026-07-13 13:18   ` Sudeep Holla
2026-07-09 12:37 ` [PATCH v1 08/17] ACPI: processor: idle: Rework first-level _LPI states processing Rafael J. Wysocki
2026-07-13 13:20   ` Sudeep Holla
2026-07-09 12:37 ` [PATCH v1 09/17] ACPI: processor: idle: Drop redundant _LPI presence checks Rafael J. Wysocki
2026-07-13 13:21   ` Sudeep Holla
2026-07-09 12:38 ` [PATCH v1 10/17] ACPI: processor: idle: Rearrange loop in acpi_processor_get_lpi_info() Rafael J. Wysocki
2026-07-13 13:21   ` Sudeep Holla
2026-07-09 12:39 ` [PATCH v1 11/17] ACPI: processor: idle: Rework flatten_lpi_states() Rafael J. Wysocki
2026-07-13 13:23   ` Sudeep Holla [this message]
2026-07-09 12:39 ` [PATCH v1 12/17] ACPI: processor: idle: Introduce too_many_states() for _LPI Rafael J. Wysocki
2026-07-13 13:23   ` Sudeep Holla
2026-07-09 12:40 ` [PATCH v1 13/17] ACPI: processor: idle: Introduce acpi_processor_extract_lpi_info() Rafael J. Wysocki
2026-07-13 13:32   ` Sudeep Holla
2026-07-09 12:41 ` [PATCH v1 14/17] ACPI: processor: idle: Relocate acpi_processor_extract_lpi_info() Rafael J. Wysocki
2026-07-13 13:30   ` Sudeep Holla
2026-07-09 12:42 ` [PATCH v1 15/17] ACPI: processor: idle: Add switch for strict _LPI processing Rafael J. Wysocki
2026-07-13 13:33   ` Sudeep Holla
2026-07-09 12:43 ` [PATCH v1 16/17] intel_idle: Prepare for adding ACPI _LPI support Rafael J. Wysocki
2026-07-09 12:44 ` [PATCH v1 17/17] intel_idle: Add " Rafael J. Wysocki
2026-07-13 14:56   ` Sudeep Holla

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=20260713-tall-precise-whale-93edc7@sudeepholla \
    --to=sudeep.holla@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    /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