Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1085815pxj; Sat, 15 May 2021 03:29:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSlI/Ngp2IDttOCH5AgF+4bRU7YUttExpcJ9fTRDp4DZJOsL2n/wbKGXN1hlG7TE2TqNo/ X-Received: by 2002:a17:906:3419:: with SMTP id c25mr6919908ejb.96.1621074544245; Sat, 15 May 2021 03:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621074544; cv=none; d=google.com; s=arc-20160816; b=mBAxpbuZSAycG306wWOy2vf7PA5hiB2ILk92cMBqcbPaM1hsI8bICNH8YYvZQK2jxZ nXXP4tS/IseeGFNpEUnnTkF2+E37wEzwpSzDzS5RRY3PbQ9CJ6IAzxchIbn7v2mxqgA0 rGuikL+qIj7ghZua4vtFFIe8kq9LpgQcNwsHL1543egu3ATKbtZ6hS/de0f8FgvFlqnw gEv6mfel8G3eL01WbnA+Y+Vq4n90jzEUlJhLmhDyYNMag2RMzbf/SodtSANiXMd2yBPt DzkbqJ8G+p6d9rH4+nQHj8cwMfqz45qJ7Et2SkUQcXFqczKT7NCrZXYpBjr14zA9i7ha O0BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=r56E3QE+8aNkblG3U0kbqoDj3zLaTNXyg9bv98lF2MQ=; b=ruRsQKVtah8iGu/yRmIlVKwyqLnbtzva6yo3YWLgZLjv5DTphJ4qlba632P6k9co07 ClWWcAZzUAagToPa+xKdHVVuGl1UAwHa/AdfLPGKf34Rbl4lTWXas/BV/YLOa6cFfSuo QuWt9wqRIesSoqxP/RVOIcKYFQzXk8kP7KFJM2IUc6D59KU6LFFI2wxn+FYxXZLoTHhL dppssYWYZtpMQl0Ug+pneTqv9tGACP7+HaQPqGNcGi/G20yfo8Q4KqMai42eBeBFnsha VtFcbY1+M1Xam2Sl1OyHhwyok9fmchpEYr6QQbgzNFHVoYIIbj3ExbB44z9datxeFwzX pb4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YxucMdfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y18si4994685edu.32.2021.05.15.03.28.41; Sat, 15 May 2021 03:29:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YxucMdfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232471AbhENVcg (ORCPT + 99 others); Fri, 14 May 2021 17:32:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:55178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229504AbhENVcf (ORCPT ); Fri, 14 May 2021 17:32:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4D9306140A; Fri, 14 May 2021 21:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621027884; bh=r4ZITb5VahQ1bp4eOnHrhuqUyrRIdgRO+1xUikzpyiU=; h=From:To:Cc:Subject:Date:From; b=YxucMdfrO3LsjOLFgbwf4gd1fZXfgu1IvyP2icIRwYCV4bedtaWMzi1WGRNs0Eowl tXuYLbhMVhEqACnTNhbLJBvJzz1S1cnhww1BzNrVek3qqJ9X7QsjegPzRvrgOmZqpY oPBoQQcwqIinJ4IBNcFEgcMigj7WzH7dbEyc1kgzL/owH6UttN0NYnfLnYd9oiqrIX Cgb5M/SOrlWGpzdDrC4AJaCUtAMk8BDOLRtOpnXef19SaUjzjnSoIVE8kHr0dIsD23 7yBmUtwPDb/CzoliYRLu9Jx7O64M1056cFB//tOzWcpL3bkMJjHuIRm0Lju5wZL0sr 0+Q1xtHzt8zhA== From: Arnd Bergmann To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Dmitry Baryshkov , Abhinav Kumar , Jonathan Marek , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH] drm/msm/dsi: fix 32-bit clang warning Date: Fri, 14 May 2021 23:30:17 +0200 Message-Id: <20210514213032.575161-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann clang is a little overzealous with warning about a constant conversion in an untaken branch of a ternary expression: drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c:975:48: error: implicit conversion from 'unsigned long long' to 'unsigned long' changes value from 5000000000 to 705032704 [-Werror,-Wconstant-conversion] .max_pll_rate = (5000000000ULL < ULONG_MAX) ? 5000000000UL : ULONG_MAX, ^~~~~~~~~~~~ Rewrite this to use a preprocessor conditional instead to avoid the warning. Fixes: 076437c9e360 ("drm/msm/dsi: move min/max PLL rate to phy config") Signed-off-by: Arnd Bergmann --- As found with another patch, using __builtin_choose_expr() would likely also work here, but doesn't seem any more readable. --- drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c index e76ce40a12ab..accd6b4eb7c2 100644 --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c @@ -972,7 +972,11 @@ const struct msm_dsi_phy_cfg dsi_phy_7nm_cfgs = { .restore_pll_state = dsi_7nm_pll_restore_state, }, .min_pll_rate = 600000000UL, - .max_pll_rate = (5000000000ULL < ULONG_MAX) ? 5000000000ULL : ULONG_MAX, +#ifdef CONFIG_64BIT + .max_pll_rate = 5000000000UL, +#else + .max_pll_rate = ULONG_MAX, +#endif .io_start = { 0xae94400, 0xae96400 }, .num_dsi_phy = 2, .quirks = DSI_PHY_7NM_QUIRK_V4_1, -- 2.29.2