]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cpuidle: governors: teo: Use s64 consistently in teo_update()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 12 Nov 2025 16:24:40 +0000 (17:24 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 14 Nov 2025 14:20:01 +0000 (15:20 +0100)
Two local variables in teo_update() are defined as u64, but their
values are then compared with s64 values, so it is more consistent
to use s64 as their data type.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Christian Loehle <christian.loehle@arm.com>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/3026616.e9J7NaK4W3@rafael.j.wysocki
drivers/cpuidle/governors/teo.c

index ada42e2ca759375ea12d78c7b2dea25b79dbdfbb..88ed47e868b9ca7dc52afd73de651e625f4cceea 100644 (file)
@@ -157,8 +157,7 @@ static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
 {
        struct teo_cpu *cpu_data = this_cpu_ptr(&teo_cpus);
        int i, idx_timer = 0, idx_duration = 0;
-       s64 target_residency_ns;
-       u64 measured_ns;
+       s64 target_residency_ns, measured_ns;
 
        cpu_data->short_idles -= cpu_data->short_idles >> DECAY_SHIFT;
 
@@ -167,9 +166,9 @@ static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
                 * If one of the safety nets has triggered, assume that this
                 * might have been a long sleep.
                 */
-               measured_ns = U64_MAX;
+               measured_ns = S64_MAX;
        } else {
-               u64 lat_ns = drv->states[dev->last_state_idx].exit_latency_ns;
+               s64 lat_ns = drv->states[dev->last_state_idx].exit_latency_ns;
 
                measured_ns = dev->last_residency_ns;
                /*