From patchwork Thu Nov 2 11:26:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 117796 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2038301qgn; Thu, 2 Nov 2017 04:27:49 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TIYMotmJ4DQa6hMURDD5Lj1VixwWA9dkceX1uhwSInSg4SGHYI8QgiE47BRf3ud6bWlmSY X-Received: by 10.99.114.19 with SMTP id n19mr3177737pgc.356.1509622069039; Thu, 02 Nov 2017 04:27:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509622069; cv=none; d=google.com; s=arc-20160816; b=0RAZ824Wh/0HJvn2MFiNAE081hvgiWSXV/3rS9R7ZKCVGzdmxyJLk5Z+wPu5ZKGaRC tQMFra+ASm5+nsjFovBCaGnzSWMR7j3kYlKWvjFLmIDBqYoW2vej4nQ0Por+/A6xsWRt M3JuBpT1OMGx4G/6ZAkB1lU578m1Vn4XOQER5Kp9XwYosEVXV51n8mRuMXEsuwwt83lA /+881gYr0OyR5rTMfV64N5n5amyFCXA3f/ES7nscDRmWAf2Ot3xE7J7zN7H6++UXFlIa lnWpMULYj2Gojk1AWlAizeCpvohXmoSCaCOAixwkytKyzMleW0wsQBr4Zg+6d2JeUBWt jmvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=iXfg+/s1+mB/iqdkg7GfXSCZ7rV0gU+nCc1ANrZuYoU=; b=k3A1m25Orz7BhnbaKtKUVO5YjZxo6qVHsfMJeRIae37yN6Mt+sqLyI75MKmt4m5WY9 PgMighQiVzzsXaG8Z/BiWY4rAICm4T9He/3cdD0TMBMhG/5rkKUA+38Q51D8OpigQrB9 JPbFkPwUhYQmDcnfN60uppKAEs7otFGDT0cpo8KhMLTq2qTxLLeUeaSentBLWmeICoCQ PmQXtiHaLLOYud7ltHgT6K6mXxa9UW0rxSBJ44uUnkpn1Ls+6WR0dkIP6rsinW8aIRZE eIbaIhXoniyPrQJ6A+n2COaVsNgsv/sgJcC6URuOZ15rhPKV0/syEfotHK4Ldf/ksOZ9 +BWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97si2193560pld.158.2017.11.02.04.27.48; Thu, 02 Nov 2017 04:27:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754242AbdKBL1q (ORCPT + 26 others); Thu, 2 Nov 2017 07:27:46 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:56195 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754153AbdKBL1n (ORCPT ); Thu, 2 Nov 2017 07:27:43 -0400 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0M8hmN-1dEQJK2gHT-00wBJz; Thu, 02 Nov 2017 12:27:33 +0100 From: Arnd Bergmann To: Alex Deucher , =?utf-8?q?Christian_K=C3=B6n?= =?utf-8?q?ig?= Cc: Arnd Bergmann , David Airlie , Harry Wentland , Tony Cheng , Dmytro Laktyushkin , Joshua Aberback , "Leo (Sunpeng) Li" , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] drm/amdgpu/display: fix integer arithmetic problem Date: Thu, 2 Nov 2017 12:26:43 +0100 Message-Id: <20171102112657.111405-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20171102112657.111405-1-arnd@arndb.de> References: <20171102112657.111405-1-arnd@arndb.de> X-Provags-ID: V03:K0:sTYaLgEnB+dgWrtDykqTffpw4GKC9CdbyBtvHCo2OSO8th8f3T0 AO+pAW1uCdj/6wryiK5+Vf1V5fy62lqjMpU0NAnn57mQf9wW415DmlKmk5nm0mJ5/eDzmDx rxwIGps2oSfFoZ8LD9w9/Lw4AWCDs2HRgi6hviHNszE5UyhSMv1T6y7jaEqVPxZLja9yf07 y2yRega7UFzrnAXe9FZZQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:ZDDlfzMdTJQ=:5Xr/dpjUeImQDLn8eq93JO pt8HfwW9ZWVeXeFgr6zF5RtHFtkJdGQWo8ztD1spzs1KtlLx/qXzAMOAGEOk403RbMYFkBRx0 bQEkpDZPav07JzV8EaPv5OscOoE2RkW4khnNtdsdzpsDsBvdDRvnPSSSdjO0bRiNI9SAF2wCd Ivqteqy6ImuhC+6DvKnWZK08K11mKe29NVKGyqozNu3gJEWQbD4uQH77HUDfBHcXZWkl1rMrg MBMLScBiCo1XonetcCAl8dEXS/OvfHbEGThR6IQn9pd7mdv6Azx3+STtEVwjqIJ9ku3ZAuu30 gtTXZiedlGV2mf4Jqf8/ccgKSqsrBr6LfOgrqV9hkVmwAHnSsRpESi0HE/v5s4xrcNRMLsZOs lQNCQqlkaeN+zYNwHwndb5JXcD3WZLEOXlzJKOUQGb9KVWUpxjIZ2fIwiO6CgqD54OtwzBvep 7OJcSHewQk19I0Ck4hJja08po1JUWEa1CW8U3g3IhtcHVngcPSk+kf6llSO/RtnO29ChQTR8H bi0UR1BuZfmXw1ul7L+kCUw5RSffy3bXP5bYZlixbc4DyoxLtl+VxJnNEVCqDd+5VtelQ2rRQ YPI/Jfj1giUdorFABXudQ9HSAMGHGv65DoCLoE2xlgaLxy3+55sBak7q5yCHxc/6oJpJWH67N /MPAwv+ekuOzbIOkGzNXYv/8/B7j0H03uV+JKmj+rUb8Y3+MwcsI84r2zvtF1J4S2+t1s6aYT BGUXnvpwVrVpbINaYG+FlTmUNXnx9vSILjzqAA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc warns about an ambiguous integer calculation: drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function 'calculate_bandwidth': drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:534:5: error: this decimal constant is unsigned only in ISO C90 [-Werror] data->lb_line_pitch = bw_ceil2(bw_mul(bw_div(bw_frc_to_fixed(2401171875, 100000000), bw_int_to_fixed(3)), bw_ceil2(data->source_width_in_lb, bw_int_to_fixed(8))), bw_int_to_fixed(48)); ^~~~ Marking the constant as explicitly unsigned makes it work fine everywhere without warnings. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 Reviewed-by: Harry Wentland diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c index 15cbfc400633..4f8a95368ffc 100644 --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c @@ -531,7 +531,7 @@ static void calculate_bandwidth( } switch (data->lb_bpc[i]) { case 8: - data->lb_line_pitch = bw_ceil2(bw_mul(bw_div(bw_frc_to_fixed(2401171875, 100000000), bw_int_to_fixed(3)), bw_ceil2(data->source_width_in_lb, bw_int_to_fixed(8))), bw_int_to_fixed(48)); + data->lb_line_pitch = bw_ceil2(bw_mul(bw_div(bw_frc_to_fixed(2401171875ul, 100000000), bw_int_to_fixed(3)), bw_ceil2(data->source_width_in_lb, bw_int_to_fixed(8))), bw_int_to_fixed(48)); break; case 10: data->lb_line_pitch = bw_ceil2(bw_mul(bw_div(bw_frc_to_fixed(300234375, 10000000), bw_int_to_fixed(3)), bw_ceil2(data->source_width_in_lb, bw_int_to_fixed(8))), bw_int_to_fixed(48));