@@ -732,46 +732,30 @@ static int __cpuidle acpi_idle_enter_s2idle(struct cpuidle_device *dev,
732732 return 0 ;
733733}
734734
735- static int acpi_processor_setup_cpuidle_cx (struct acpi_processor * pr ,
736- struct cpuidle_device * dev )
735+ static void acpi_processor_setup_cpuidle_cx (struct acpi_processor * pr ,
736+ struct cpuidle_device * dev )
737737{
738738 int i , count = ACPI_IDLE_STATE_START ;
739739 struct acpi_processor_cx * cx ;
740- struct cpuidle_state * state ;
741740
742741 if (max_cstate == 0 )
743742 max_cstate = 1 ;
744743
745744 for (i = 1 ; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate ; i ++ ) {
746- state = & acpi_idle_driver .states [count ];
747745 cx = & pr -> power .states [i ];
748746
749747 if (!cx -> valid )
750748 continue ;
751749
752750 per_cpu (acpi_cstate [count ], dev -> cpu ) = cx ;
753751
754- if (lapic_timer_needs_broadcast (pr , cx ))
755- state -> flags |= CPUIDLE_FLAG_TIMER_STOP ;
756-
757- if (cx -> type == ACPI_STATE_C3 ) {
758- state -> flags |= CPUIDLE_FLAG_TLB_FLUSHED ;
759- if (pr -> flags .bm_check )
760- state -> flags |= CPUIDLE_FLAG_RCU_IDLE ;
761- }
762-
763752 count ++ ;
764753 if (count == CPUIDLE_STATE_MAX )
765754 break ;
766755 }
767-
768- if (!count )
769- return - EINVAL ;
770-
771- return 0 ;
772756}
773757
774- static int acpi_processor_setup_cstates (struct acpi_processor * pr )
758+ static void acpi_processor_setup_cstates (struct acpi_processor * pr )
775759{
776760 int i , count ;
777761 struct acpi_processor_cx * cx ;
@@ -818,17 +802,21 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr)
818802 if (cx -> type != ACPI_STATE_C1 && !acpi_idle_fallback_to_c1 (pr ))
819803 state -> enter_s2idle = acpi_idle_enter_s2idle ;
820804
805+ if (lapic_timer_needs_broadcast (pr , cx ))
806+ state -> flags |= CPUIDLE_FLAG_TIMER_STOP ;
807+
808+ if (cx -> type == ACPI_STATE_C3 ) {
809+ state -> flags |= CPUIDLE_FLAG_TLB_FLUSHED ;
810+ if (pr -> flags .bm_check )
811+ state -> flags |= CPUIDLE_FLAG_RCU_IDLE ;
812+ }
813+
821814 count ++ ;
822815 if (count == CPUIDLE_STATE_MAX )
823816 break ;
824817 }
825818
826819 drv -> state_count = count ;
827-
828- if (!count )
829- return - EINVAL ;
830-
831- return 0 ;
832820}
833821
834822static inline void acpi_processor_cstate_first_run_checks (void )
@@ -1243,7 +1231,8 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr)
12431231 if (pr -> flags .has_lpi )
12441232 return acpi_processor_setup_lpi_states (pr );
12451233
1246- return acpi_processor_setup_cstates (pr );
1234+ acpi_processor_setup_cstates (pr );
1235+ return 0 ;
12471236}
12481237
12491238/**
@@ -1263,7 +1252,8 @@ static int acpi_processor_setup_cpuidle_dev(struct acpi_processor *pr,
12631252 if (pr -> flags .has_lpi )
12641253 return acpi_processor_ffh_lpi_probe (pr -> id );
12651254
1266- return acpi_processor_setup_cpuidle_cx (pr , dev );
1255+ acpi_processor_setup_cpuidle_cx (pr , dev );
1256+ return 0 ;
12671257}
12681258
12691259static int acpi_processor_get_power_info (struct acpi_processor * pr )
0 commit comments