]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/msm/dsi: fix 32-bit clang warning
authorArnd Bergmann <arnd@arndb.de>
Fri, 14 May 2021 21:30:17 +0000 (23:30 +0200)
committerRob Clark <robdclark@chromium.org>
Wed, 23 Jun 2021 14:33:53 +0000 (07:33 -0700)
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 <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210514213032.575161-1-arnd@kernel.org
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c

index 6f96fbac8282404e2b95916865074f974c4adce1..ff9931c70aa7a09a8a674f5679c232ac47ddbe37 100644 (file)
@@ -973,7 +973,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,