From patchwork Tue Feb 26 14:25:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 10830345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB6C81880 for ; Tue, 26 Feb 2019 14:26:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C701E2C5B3 for ; Tue, 26 Feb 2019 14:26:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C51042C643; Tue, 26 Feb 2019 14:26:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 79E372C5B3 for ; Tue, 26 Feb 2019 14:26:16 +0000 (UTC) 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: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7yLkXNdznDZ2DdIJSU1YI79VQXQGF9ZFUtw/1mvN0l4=; b=sPJUY48SH3ovPl TmC1D5hHq7cFi0hgnHHYUzyPusJOkInf0tJD4ZQKk1d5srp6R5cO8qbRBiCC68FJPz8TAacldTNf7 lw9kEiZ3mfr0ySs+UZCyCs0m0jRQqAvq+Zy2+CTiHfPW56nBwd36+lp8rw0ewoHFefo7YE5RZww56 iU9ZtumYYe6pgWbxI00xupJU+nUKakHW85BO2bUhTAMH8VrPiESPrx1MTMLu6E6L8PLBV1Xwz2j9Q ea+Mc9eB/so8lpliz9eVG1GMhDLpOD/3phHTs6oBI7Tb5oo0iGJszv9wZcM+CrVqYE21axq9TVMUR ocabowNLmM58YlA6+RNw==; 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 1gydgV-0002m4-KU; Tue, 26 Feb 2019 14:26:15 +0000 Received: from relay10.mail.gandi.net ([217.70.178.230]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gydgK-0002dU-Hl for linux-arm-kernel@lists.infradead.org; Tue, 26 Feb 2019 14:26:07 +0000 Received: from localhost (aaubervilliers-681-1-27-150.w90-88.abo.wanadoo.fr [90.88.147.150]) (Authenticated sender: maxime.ripard@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 8F6E7240006; Tue, 26 Feb 2019 14:25:59 +0000 (UTC) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard Subject: [PATCH 3/4] drm/sun4i: Move rate variables to long long Date: Tue, 26 Feb 2019 15:25:48 +0100 Message-Id: <022c3b850413edd6afbca20062f100971de2f5af.1551191081.git-series.maxime.ripard@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190226_062604_757504_D9E25DBD X-CRM114-Status: GOOD ( 10.22 ) 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: Paul Kocialkowski , Maarten Lankhorst , dri-devel@lists.freedesktop.org, Sean Paul , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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");