From: Daniel Vetter <daniel@ffwll.ch>
To: Kees Cook <keescook@chromium.org>
Cc: linux-kernel@vger.kernel.org,
Stephen Rothwell <sfr@canb.auug.org.au>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
David Airlie <airlied@linux.ie>,
dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: use do_div() as needed in debugfs code
Date: Wed, 13 Mar 2013 21:18:09 +0100 [thread overview]
Message-ID: <20130313201809.GB1896@bremse> (raw)
In-Reply-To: <20130312054631.GA21167@www.outflux.net>
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@chromium.org>
> Cc: Daniel Vetter <daniel.vetter@ffwll.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
prev parent reply other threads:[~2013-03-13 20:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 5:46 [PATCH] drm/i915: use do_div() as needed in debugfs code Kees Cook
2013-03-13 20:18 ` Daniel Vetter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130313201809.GB1896@bremse \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).