From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Maxime Ripard <maxime.ripard@bootlin.com>, Chen-Yu Tsai <wens@csie.org>
Cc: Sean Paul <seanpaul@chromium.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
linux-arm-kernel@lists.infradead.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/4] drm/sun4i: Move rate variables to long long
Date: Thu, 07 Mar 2019 14:30:21 +0100 [thread overview]
Message-ID: <4fe1f76d3edec5cc9019de41bdb8a7eea7befff4.camel@bootlin.com> (raw)
In-Reply-To: <022c3b850413edd6afbca20062f100971de2f5af.1551191081.git-series.maxime.ripard@bootlin.com>
Hi,
On Tue, 2019-02-26 at 15:25 +0100, Maxime Ripard wrote:
> Our clock rate variables are getting pretty close to the LONG_MAX / ULONG_MAX
> limit, especially since we will start doing arithmetic on it. Move those
> types to unsigned long long to be sure we don't overflow their type.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Cheers,
Paul
> ---
> drivers/gpu/drm/sun4i/sun4i_rgb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c
> index 8a43ed46af82..893b6e6d4d85 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
> @@ -60,8 +60,8 @@ static enum drm_mode_status sun4i_rgb_mode_valid(struct drm_encoder *crtc,
> struct sun4i_tcon *tcon = rgb->tcon;
> u32 hsync = mode->hsync_end - mode->hsync_start;
> u32 vsync = mode->vsync_end - mode->vsync_start;
> - unsigned long rate = mode->clock * 1000;
> - long rounded_rate;
> + unsigned long long rate = mode->clock * 1000;
> + unsigned long long rounded_rate;
>
> DRM_DEBUG_DRIVER("Validating modes...\n");
>
--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-03-07 13:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-26 14:25 [PATCH 0/4] drm/sun4i: rgb: Relax the pixel clock check Maxime Ripard
2019-02-26 14:25 ` [PATCH 1/4] drm/sun4i: Move the panel pointer from the TCON to the encoders Maxime Ripard
2019-03-07 13:29 ` Paul Kocialkowski
2019-02-26 14:25 ` [PATCH 2/4] drm/sun4i: rgb: Store the bridge pointer Maxime Ripard
2019-03-07 13:29 ` Paul Kocialkowski
2019-02-26 14:25 ` [PATCH 3/4] drm/sun4i: Move rate variables to long long Maxime Ripard
2019-03-07 13:30 ` Paul Kocialkowski [this message]
2019-02-26 14:25 ` [PATCH 4/4] drm/sun4i: rgb: Change the pixel clock validation check Maxime Ripard
2019-02-27 3:55 ` kbuild test robot
2019-03-07 13:36 ` Paul Kocialkowski
2019-03-06 5:50 ` [PATCH 0/4] drm/sun4i: rgb: Relax the pixel clock check Vasily Khoruzhick
2019-03-07 13:50 ` Maxime Ripard
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=4fe1f76d3edec5cc9019de41bdb8a7eea7befff4.camel@bootlin.com \
--to=paul.kocialkowski@bootlin.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=maxime.ripard@bootlin.com \
--cc=seanpaul@chromium.org \
--cc=wens@csie.org \
/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).