lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 13 Mar 2013 21:18:09 +0100
From:	Daniel Vetter <daniel@...ll.ch>
To:	Kees Cook <keescook@...omium.org>
Cc:	linux-kernel@...r.kernel.org,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	Daniel Vetter <daniel.vetter@...ll.ch>,
	David Airlie <airlied@...ux.ie>,
	dri-devel@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org
Subject: Re: [PATCH] drm/i915: use do_div() as needed in debugfs code

On Mon, Mar 11, 2013 at 10:46:31PM -0700, Kees Cook wrote:
> This replaces the open-coded divisions in the debugfs code by calls
> to do_div().
> 
> Signed-off-by: Kees Cook <keescook@...omium.org>
> Cc: Daniel Vetter <daniel.vetter@...ll.ch>

Squashed into the debugfs patch which introduced this regression, thanks
for the quick fixup.
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_debugfs.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index d86c304..6f3cbf8 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1814,9 +1814,9 @@ i915_max_freq_set(void *data, u64 val)
>  	/*
>  	 * Turbo will still be enabled, but won't go above the set value.
>  	 */
> -	dev_priv->rps.max_delay = val / GT_FREQUENCY_MULTIPLIER;
> -
> -	gen6_set_rps(dev, val / GT_FREQUENCY_MULTIPLIER);
> +	do_div(val, GT_FREQUENCY_MULTIPLIER);
> +	dev_priv->rps.max_delay = val;
> +	gen6_set_rps(dev, val);
>  	mutex_unlock(&dev_priv->rps.hw_lock);
>  
>  	return 0;
> @@ -1865,9 +1865,9 @@ i915_min_freq_set(void *data, u64 val)
>  	/*
>  	 * Turbo will still be enabled, but won't go below the set value.
>  	 */
> -	dev_priv->rps.min_delay = val / GT_FREQUENCY_MULTIPLIER;
> -
> -	gen6_set_rps(dev, val / GT_FREQUENCY_MULTIPLIER);
> +	do_div(val, GT_FREQUENCY_MULTIPLIER);
> +	dev_priv->rps.min_delay = val;
> +	gen6_set_rps(dev, val);
>  	mutex_unlock(&dev_priv->rps.hw_lock);
>  
>  	return 0;
> -- 
> 1.7.9.5
> 
> 
> -- 
> Kees Cook
> Chrome OS Security

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ