cpuidle: teo: Take negative "sleep length" values into account
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 29 Mar 2021 18:21:43 +0000 (20:21 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 7 Apr 2021 17:26:44 +0000 (19:26 +0200)
commit030adec9f68e30cbbc24c57296a141943177c148
tree979a1c931719ca16cebf265ed0c8325a4f3c73a0
parentd3c33be1f350e7fd2b04381b000f3f950bd1ba77
cpuidle: teo: Take negative "sleep length" values into account

Modify the TEO governor to take possible negative return values of
tick_nohz_get_next_hrtimer() into account by changing the data type
of some variables used by it to s64 which allows it to carry out
computations without potentially problematic data type conversions
into u64.

Also change the computations in teo_select() so that the negative
values themselves are handled in a natural way to avoid adding extra
negative value checks to that function.

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