Re: [PATCH v1 11/17] ACPI: processor: idle: Rework flatten_lpi_states()

"lihuisong (C)" <[email protected]>
Newsgroups org.kernel.vger.linux-acpi,org.kernel.vger.linux-pm
Message-ID <[email protected]>
On 7/9/2026 8:39 PM, Rafael J. Wysocki wrote:
> From: "Rafael J. Wysocki" <[email protected]>
>
> 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.
>
> No intentional functional impact beyond the message printed when
> the count of flattened states is too large.
>
> Signed-off-by: Rafael J. Wysocki <[email protected]>
> ---
Acked-by: Huisong Li <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.