mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-17 13:18:00 +07:00
drm/i915: Use clamp_t() when limiting cur_delay
Make the cur_delay limiting code a bit less prone to typo errors by using clamp_t(). Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
4c7915616a
commit
1272e7b854
@ -966,10 +966,8 @@ static void gen6_pm_rps_work(struct work_struct *work)
|
||||
/* sysfs frequency interfaces may have snuck in while servicing the
|
||||
* interrupt
|
||||
*/
|
||||
if (new_delay < (int)dev_priv->rps.min_delay)
|
||||
new_delay = dev_priv->rps.min_delay;
|
||||
if (new_delay > (int)dev_priv->rps.max_delay)
|
||||
new_delay = dev_priv->rps.max_delay;
|
||||
new_delay = clamp_t(int, new_delay,
|
||||
dev_priv->rps.min_delay, dev_priv->rps.max_delay);
|
||||
dev_priv->rps.last_adj = new_delay - dev_priv->rps.cur_delay;
|
||||
|
||||
if (IS_VALLEYVIEW(dev_priv->dev))
|
||||
|
Loading…
Reference in New Issue
Block a user