From patchwork Fri May 14 21:30:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 438960 Delivered-To: patch@linaro.org Received: by 2002:a02:b78d:0:0:0:0:0 with SMTP id f13csp682675jam; Fri, 14 May 2021 14:31:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbXoknCBrz5K9jzvSEoxak1dpBb57aOpDwc5PSHWVlgnknh3914nmNWSiiE+l8g4ZvYafK X-Received: by 2002:a17:906:5855:: with SMTP id h21mr51064498ejs.522.1621027887200; Fri, 14 May 2021 14:31:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621027887; cv=none; d=google.com; s=arc-20160816; b=EHw1uSRlrbllpMoUFoFSDwkvz8DbV9K23fyOkO/FQXcUIz4xYWdP6aEFmu4nXKGpE/ 6Kp2P7mZNSBvBlwZ+f1uviYPzTDuBbyq8YsVgxtZctqNiq0IjFaZviVL6fJ3xbwnbUcH a9ESBfS512/5gj33ntjzOy1RHfaNNUPs4QeQoGsXDeSpCYmuv833yfhxeRi3t1VdUsX0 fRkHzeTR67Ua8FcbByM7MjQHjpbKctM8AXwlwIlEWGBzm/UhV/d1IqU0oR8EyjMXxzpw Vz1nRVMKOebxqzxOPLtJl5+JrZfoNNMG/uXMsI5vX7lOn2Y1+SX5GTQ9MUa3YeW8/Voq kT0A== 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=EGD00L9+pddYrZ+BIrrx7dX+4Zy+Kd1ZblmwQ6M5nFSj5BinYeIMtxvuoGQldCIvyh 1iJEglwSHLhbBKehWaBbIg9//RZkiTvre+CyzddcLCQrGyYuXYxZgaGNlAxbtCPhOC0V 0pOZYgHInSL0z8QHthNK7hZCkPdL5Z3NmTgP05rUfKia6goblZ2RiP8Lh4En4ZLinmXO gNbpX1KGtt2kfh8UAIlmKyDuIoCB0sKZVJVk6Qj/wytYy/ekVhtNhLv22JpSlT608/P6 chfxbhIJsFmFcYSTlb+H9iehHLH+fzFzQk5X4PmsKzXHRB5aRtxwwXoNqVQTopnr0Zkb QQ5g== 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-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 p8si3578627edq.262.2021.05.14.14.31.26; Fri, 14 May 2021 14:31:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-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-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S232369AbhENVcg (ORCPT + 17 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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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(-) -- 2.29.2 Reviewed-by: Nathan Chancellor Reviewed-by: Dmitry Baryshkov 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,