linux/drivers/idle
Artem Bityutskiy a78032e94b 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: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Reviewed-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2023-04-27 19:37:36 +02:00
..
intel_idle.c intel_idle: clean up intel_idle_init_cstates_icpu() 2023-04-27 19:37:36 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00