diff options
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r-- | drivers/acpi/processor_idle.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 573b6a97bb1f..70d8a6ec0920 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -514,8 +514,6 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr) | |||
514 | 514 | ||
515 | static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) | 515 | static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) |
516 | { | 516 | { |
517 | int i; | ||
518 | |||
519 | ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_fadt"); | 517 | ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_fadt"); |
520 | 518 | ||
521 | if (!pr) | 519 | if (!pr) |
@@ -524,8 +522,7 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) | |||
524 | if (!pr->pblk) | 522 | if (!pr->pblk) |
525 | return_VALUE(-ENODEV); | 523 | return_VALUE(-ENODEV); |
526 | 524 | ||
527 | for (i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++) | 525 | memset(pr->power.states, 0, sizeof(pr->power.states)); |
528 | memset(pr->power.states, 0, sizeof(struct acpi_processor_cx)); | ||
529 | 526 | ||
530 | /* if info is obtained from pblk/fadt, type equals state */ | 527 | /* if info is obtained from pblk/fadt, type equals state */ |
531 | pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1; | 528 | pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1; |
@@ -555,13 +552,9 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) | |||
555 | 552 | ||
556 | static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr) | 553 | static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr) |
557 | { | 554 | { |
558 | int i; | ||
559 | |||
560 | ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_default_c1"); | 555 | ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_default_c1"); |
561 | 556 | ||
562 | for (i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++) | 557 | memset(pr->power.states, 0, sizeof(pr->power.states)); |
563 | memset(&(pr->power.states[i]), 0, | ||
564 | sizeof(struct acpi_processor_cx)); | ||
565 | 558 | ||
566 | /* if info is obtained from pblk/fadt, type equals state */ | 559 | /* if info is obtained from pblk/fadt, type equals state */ |
567 | pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1; | 560 | pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1; |
@@ -873,7 +866,8 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr) | |||
873 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { | 866 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { |
874 | if (pr->power.states[i].valid) { | 867 | if (pr->power.states[i].valid) { |
875 | pr->power.count = i; | 868 | pr->power.count = i; |
876 | pr->flags.power = 1; | 869 | if (pr->power.states[i].type >= ACPI_STATE_C2) |
870 | pr->flags.power = 1; | ||
877 | } | 871 | } |
878 | } | 872 | } |
879 | 873 | ||