Skip to content

Commit 4d613fb

Browse files
LiHuiSong1rafaeljw
authored andcommitted
ACPI: processor: idle: Remove redundant static variable and rename cstate check function
The function acpi_processor_cstate_first_run_checks() is currently called only once during initialization in acpi_processor_register_idle_driver(). Since its execution is already limited by the caller's lifecycle, the internal static 'first_run' variable is redundant and can be safely removed. Additionally, the current function name is no longer descriptive of its behavior, so rename the function to acpi_processor_update_max_cstate() to better reflect its actual purpose. Signed-off-by: Huisong Li <lihuisong@huawei.com> Link: https://patch.msgid.link/20260311065038.4151558-4-lihuisong@huawei.com [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 1f23194 commit 4d613fb

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

drivers/acpi/processor_idle.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -819,19 +819,13 @@ static void acpi_processor_setup_cstates(struct acpi_processor *pr)
819819
drv->state_count = count;
820820
}
821821

822-
static inline void acpi_processor_cstate_first_run_checks(void)
822+
static inline void acpi_processor_update_max_cstate(void)
823823
{
824-
static int first_run;
825-
826-
if (first_run)
827-
return;
828824
dmi_check_system(processor_power_dmi_table);
829825
max_cstate = acpi_processor_cstate_check(max_cstate);
830826
if (max_cstate < ACPI_C_STATES_MAX)
831827
pr_notice("processor limited to max C-state %d\n", max_cstate);
832828

833-
first_run++;
834-
835829
if (nocst)
836830
return;
837831

@@ -840,7 +834,7 @@ static inline void acpi_processor_cstate_first_run_checks(void)
840834
#else
841835

842836
static inline int disabled_by_idle_boot_param(void) { return 0; }
843-
static inline void acpi_processor_cstate_first_run_checks(void) { }
837+
static inline void acpi_processor_update_max_cstate(void) { }
844838
static int acpi_processor_get_cstate_info(struct acpi_processor *pr)
845839
{
846840
return -ENODEV;
@@ -1359,7 +1353,7 @@ void acpi_processor_register_idle_driver(void)
13591353
int ret = -ENODEV;
13601354
int cpu;
13611355

1362-
acpi_processor_cstate_first_run_checks();
1356+
acpi_processor_update_max_cstate();
13631357

13641358
/*
13651359
* ACPI idle driver is used by all possible CPUs.

0 commit comments

Comments
 (0)