From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACC63C43381 for ; Thu, 7 Mar 2019 13:30:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7BE5520684 for ; Thu, 7 Mar 2019 13:30:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uteBUAd5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BE5520684 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EHxLuEcwO4I9ezjCpogPtwoHl2fXv3nNSfw73Q/ZK1w=; b=uteBUAd5XYPCFG 3pFR3WESeNLUhk/pW6mjdICBVTfPQlxQHmHOoPaDYjf4EEkjDqXr5bDix2q8QtfFq7PFXqncniHGd F0xYp1vYCRg4+PhxPr911CXlRy4lR5Lvl2pqAjeJFGAibm9HtvH2QTtGU5ppQDv+vaSTv77DMMV8S C4f25Z9+FdNOj/+ULljs12eJsa3H+8kutfAJqFe+avLDVrUIKNQljmiPO6WPIozamyACSNdYaESe9 d1T+sZW5j0JJo7+Mq372JLFzw/lAGOZlY/wSK6zls+Qb5SsAX/5z76YelXIu0oFNGI2wAe48Apvxh F7zFKa6M6eoiKOwoAxlg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1t6Y-0001Z9-86; Thu, 07 Mar 2019 13:30:34 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1t6O-0001WG-7E for linux-arm-kernel@lists.infradead.org; Thu, 07 Mar 2019 13:30:32 +0000 X-Originating-IP: 90.88.150.179 Received: from aptenodytes (aaubervilliers-681-1-31-179.w90-88.abo.wanadoo.fr [90.88.150.179]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 9AA101BF212; Thu, 7 Mar 2019 13:30:21 +0000 (UTC) Message-ID: <4fe1f76d3edec5cc9019de41bdb8a7eea7befff4.camel@bootlin.com> Subject: Re: [PATCH 3/4] drm/sun4i: Move rate variables to long long From: Paul Kocialkowski To: Maxime Ripard , Chen-Yu Tsai Date: Thu, 07 Mar 2019 14:30:21 +0100 In-Reply-To: <022c3b850413edd6afbca20062f100971de2f5af.1551191081.git-series.maxime.ripard@bootlin.com> References: <022c3b850413edd6afbca20062f100971de2f5af.1551191081.git-series.maxime.ripard@bootlin.com> Organization: Bootlin User-Agent: Evolution 3.30.5 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190307_053024_409545_E28C8E27 X-CRM114-Status: GOOD ( 12.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Paul , Maarten Lankhorst , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: Paul Kocialkowski 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