]> asedeno.scripts.mit.edu Git - linux.git/commit
cpuidle: enter_state: Don't needlessly calculate diff time
authorFieah Lim <kw@fieahl.im>
Mon, 10 Sep 2018 21:47:25 +0000 (05:47 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 18 Sep 2018 07:32:56 +0000 (09:32 +0200)
commit7037b43e0076cce1c07c72540e219fb5db7ea01f
treefe6ad1caf17aa94e1bec2891da7423ff00581b52
parent6a5f95b5a4f4ff29e4071bc5b95f8f3a2aef046b
cpuidle: enter_state: Don't needlessly calculate diff time

Currently, ktime_us_delta() is invoked unconditionally to compute the
idle residency of the CPU, but it only makes sense to do that if a
valid idle state has been entered, so move the ktime_us_delta()
invocation after the entered_state >= 0 check.

While at it, merge two comment blocks in there into one and drop
a space between type casting of diff.

This patch has no functional changes.

Signed-off-by: Fieah Lim <kw@fieahl.im>
[ rjw: Changelog cleanup, comment format fix ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpuidle/cpuidle.c