Skip to content

Commit 01f6c73

Browse files
superm1rafaeljw
authored andcommitted
cpuidle: PSCI: Move the has_lpi check to the beginning of the function
Currently the first thing checked is whether the PCSI cpu_suspend function has been initialized. Another change will be overloading `acpi_processor_ffh_lpi_probe` and calling it sooner. So make the `has_lpi` check the first thing checked to prepare for that change. Reviewed-by: Sudeep Holla <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 7e57714 commit 01f6c73

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/arm64/kernel/cpuidle.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ static int psci_acpi_cpu_init_idle(unsigned int cpu)
5454
struct acpi_lpi_state *lpi;
5555
struct acpi_processor *pr = per_cpu(processors, cpu);
5656

57+
if (unlikely(!pr || !pr->flags.has_lpi))
58+
return -EINVAL;
59+
5760
/*
5861
* If the PSCI cpu_suspend function hook has not been initialized
5962
* idle states must not be enabled, so bail out
6063
*/
6164
if (!psci_ops.cpu_suspend)
6265
return -EOPNOTSUPP;
6366

64-
if (unlikely(!pr || !pr->flags.has_lpi))
65-
return -EINVAL;
66-
6767
count = pr->power.count - 1;
6868
if (count <= 0)
6969
return -ENODEV;

0 commit comments

Comments
 (0)