Skip to content
Snippets Groups Projects
Commit 97242d41 authored by David Arcari's avatar David Arcari
Browse files

intel_idle: clean up intel_idle_init_cstates_icpu()

JIRA: https://issues.redhat.com/browse/RHEL-11351



commit a78032e9
Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Date:   Thu Apr 20 09:47:18 2023 +0300

    intel_idle: clean up intel_idle_init_cstates_icpu()

    The intel_idle_init_cstates_icpu() function includes a loop that iterates
    over every C-state. Inside the loop, the same C-state data is referenced 2
    ways:
     1. as cpuidle_state_table[cstate]
     2. as drv->states[drv->state_count] (but it is a copy of #1, not the same
        object).

    Make the code be more consistent and easier to read by using only the 2nd
    way. So the code structure would be as follows:

     1. Use cpuidle_state_table[cstate]
     2. Copy cpuidle_state_table[cstate] to drv->states[drv->state_count]
     3. Use only drv->states[drv->state_count] from this point.

    Note, this change introduces a checkpatch.pl warning (too long line), but it
    will be addressed in the next patch.

Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Reviewed-by: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>

Signed-off-by: default avatarDavid Arcari <darcari@redhat.com>
parent 6a35e45a
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment