On Thu, Nov 07, 2013 at 10:56:52AM -0800, Jesse Barnes wrote: > On Thu, 7 Nov 2013 19:57:49 +0200 > ville.syrjala@xxxxxxxxxxxxxxx wrote: > > > From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> > > > > 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@xxxxxxxxxxxxxxx> > > --- > > drivers/gpu/drm/i915/i915_irq.c | 6 ++---- > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c > > index 54338cf..b940ebe 100644 > > --- a/drivers/gpu/drm/i915/i915_irq.c > > +++ b/drivers/gpu/drm/i915/i915_irq.c > > @@ -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)) > > What a nice little helper. Indeed. > > Reviewed-by: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx> Both patches merged to dinq, thanks. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx