intel_idle: Simplify LAPIC timer reliability checks
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 6 Feb 2020 17:40:54 +0000 (18:40 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 11 Feb 2020 22:34:57 +0000 (23:34 +0100)
commit40ab82e08d789d8f4437fec63142b40120c1c50f
treed1324c99fe2e2b139b175ea57ad8393c53dbe25b
parentbb6d3fb354c5ee8d6bde2d576eb7220ea09862b9
intel_idle: Simplify LAPIC timer reliability checks

The lapic_timer_always_reliable variable really takes only two values
and some arithmetic in intel_idle() related to comparing it with the
target C-state's MWAIT hint value is unnecessary.

Simplify the code by replacing lapic_timer_always_reliable with
a bool variable lapic_timer_always_reliable and dropping the
LAPIC_TIMER_ALWAYS_RELIABLE symbol along with the excess
computations in intel_idle().

While at it, add a comment explaining the branch taken in intel_idle()
if the LAPIC timer is only reliable in C1 and modify the related debug
message in intel_idle_init() accordingly (the modification of this
message in the only expected functional impact of the change made
here).

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/idle/intel_idle.c