Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1097294pxj; Sat, 15 May 2021 03:54:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRU/EQAVR6RAMmovxbjlQZdkThwDbV/nslpDCHdK8pu8/aHWI2yxW7lK8RA7pasEb3OTE+ X-Received: by 2002:a05:6602:718:: with SMTP id f24mr36810990iox.59.1621076049556; Sat, 15 May 2021 03:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621076049; cv=none; d=google.com; s=arc-20160816; b=Y4igde5EG/VwjKB53aKPymNXeAL1vKMRvjTiikMsjwsqkghLRxmW45hudsUgipahNn K2xgFURWZv8rARkhVJfEDlMJt/n4TCn1GHjX7c+j1EQUeEo4zoMTcAWDNl41HHR8fXdQ Cg8r6EI5eImqtq5A8BpwdSeYT6DpQA4ovTvLa+Z2A8OOkuVHpT0GyeSX+ZvsjSnUu1xy t6Z0WF7QbPirxDfKaMp0OHm066+QkxAdiEZzvoiIPN14KPLCsPW7YhuTL84al7QE1CgD YSNeQP6o2uILshMZAxfOHgzsHcr1TTE0DsbtgdX1740clRljU5anskbZKxla1ytgW8GU 4ufQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IbrQjxkb0K3z7ZkPDbwumBPr7QnDKgJDV9MYg72KtXI=; b=n2drWz5i3+Tvb/UZTi+lf7fzaMb3LJD+lfYlVFTpfmhMeGt6rdpYt0BdE31bwnaKAd PkDD81tbKBr2RkvuJJj51YcLsrSqc5LsoXTCJsTJZ8KQGGvhMBIX0oKHHrVIMHUkJS4H YiWuBxYBQ5ms/TxrNiLlQAcAhfsoKeXarYiVD4T0RRrCoGbICJnQ5XdrUPfSSuTLqQcQ 4f2Wn3Xr1Ok7xXHhOzkJoXZZA1ZcY8LDpLlUoOk21/B86ThyJBr9xFZAOK1G9WjQ39La AC4tk6RvibvhKhQSNtqF3ArKfPMNMjGN/HtNSbzf+Rs9vkelFFoEMkgwj5y71SkIfpWo TrIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="dx1Df5/y"; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si10323403ilq.36.2021.05.15.03.53.56; Sat, 15 May 2021 03:54:09 -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=@linaro.org header.s=google header.b="dx1Df5/y"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229942AbhENWIr (ORCPT + 99 others); Fri, 14 May 2021 18:08:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232880AbhENWIp (ORCPT ); Fri, 14 May 2021 18:08:45 -0400 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0475CC061756 for ; Fri, 14 May 2021 15:07:32 -0700 (PDT) Received: by mail-qt1-x833.google.com with SMTP id t7so725024qtn.3 for ; Fri, 14 May 2021 15:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IbrQjxkb0K3z7ZkPDbwumBPr7QnDKgJDV9MYg72KtXI=; b=dx1Df5/yzY+AeZz/rdkuLnqLf65GYwH3dHIFCdSBqpHR3fWG5VtvM11+v8Pz0I424K /CTN93UfyjlVQMv7eSajh07I4QztMYX0OMg0CHIOA2eA2JA68b/3utBkLzotkWwEGMYo pnph5wO/Gl8XUyBVgaIP6DIgLVnP/tHjlk/sY1uNq1c5iAz2ltn/TpK+gz9uARdDWfNz KE0Nouw9d71fwOyDTx1rde2xAF4byNR1HtLY4UzwVp7KueySru6gKGgLUrpUX49QoMAW qLKZzxO74ljfE8ocXZcXcgy7UgDj2/GzwxBgMcm3+7UlIM8aqyxYD+tC5H2LRLvBx7cp eZKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IbrQjxkb0K3z7ZkPDbwumBPr7QnDKgJDV9MYg72KtXI=; b=gqBnF9t8vNUubhaB9A3OEC0KjnHDcHXOGv+5myXCdbrIdMkV0I3Qrf/eBjhEESKDXE RcvTtr7WRde6fNM/8VWgWVMhT46Q6ywCQDk4BgrsK1exOEEY9H1PbgGTPxRKmELYBuCI NDQOUZ9g3ttxMa+iZgIZMveoqDZEFHpa8CKSs2YnlwOfxSw6asOmj3vSsKa49rNe8/55 l37Wqg6u6PwqSA09VYc248tVidlpniEe2aiwltakibxc0xe4O6MC5hg5JjchJtWLH6QB 0qocByzcT8Y4P+oGDcOnycYqwnxSe1MN4jUZDe3dqVAZe2JszgIP/lTvX6eDeEIeVoya oScw== X-Gm-Message-State: AOAM530g4CZRvfiHHOa+hTezdOwey7x4LOVumbcCsRfy1UBFt76U5UoT abb/kOWiUlQc8fWZmHq8LUf6UI8yjgbQa4401QC1aQ== X-Received: by 2002:ac8:5810:: with SMTP id g16mr44371397qtg.135.1621030052188; Fri, 14 May 2021 15:07:32 -0700 (PDT) MIME-Version: 1.0 References: <20210514213032.575161-1-arnd@kernel.org> In-Reply-To: <20210514213032.575161-1-arnd@kernel.org> From: Dmitry Baryshkov Date: Sat, 15 May 2021 01:07:21 +0300 Message-ID: Subject: Re: [PATCH] drm/msm/dsi: fix 32-bit clang warning To: Arnd Bergmann Cc: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Abhinav Kumar , Jonathan Marek , "open list:DRM DRIVER FOR MSM ADRENO GPU" , "open list:DRM DRIVER FOR MSM ADRENO GPU" , freedreno , open list , clang-built-linux@googlegroups.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 15 May 2021 at 00:31, Arnd Bergmann wrote: > > 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 Reviewed-by: Dmitry Baryshkov > --- > 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 > -- With best wishes Dmitry