]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/msm/a6xx: Use "else if" in GPU speedbin rev matching
authorKonrad Dybcio <konrad.dybcio@linaro.org>
Thu, 15 Jun 2023 23:20:58 +0000 (01:20 +0200)
committerRob Clark <robdclark@chromium.org>
Sun, 18 Jun 2023 18:34:30 +0000 (11:34 -0700)
The GPU can only be one at a time. Turn a series of ifs into if +
elseifs to save some CPU cycles.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/542770/
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/adreno/a6xx_gpu.c

index 97e261d3331241ffe44952c27e8c7ff63526780f..d0ba0844079c9bc284a0d8ae0954ce7120f624e8 100644 (file)
@@ -2276,16 +2276,16 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse)
        if (adreno_cmp_rev(ADRENO_REV(6, 1, 8, ANY_ID), rev))
                val = a618_get_speed_bin(fuse);
 
-       if (adreno_cmp_rev(ADRENO_REV(6, 1, 9, ANY_ID), rev))
+       else if (adreno_cmp_rev(ADRENO_REV(6, 1, 9, ANY_ID), rev))
                val = a619_get_speed_bin(fuse);
 
-       if (adreno_cmp_rev(ADRENO_REV(6, 3, 5, ANY_ID), rev))
+       else if (adreno_cmp_rev(ADRENO_REV(6, 3, 5, ANY_ID), rev))
                val = adreno_7c3_get_speed_bin(fuse);
 
-       if (adreno_cmp_rev(ADRENO_REV(6, 4, 0, ANY_ID), rev))
+       else if (adreno_cmp_rev(ADRENO_REV(6, 4, 0, ANY_ID), rev))
                val = a640_get_speed_bin(fuse);
 
-       if (adreno_cmp_rev(ADRENO_REV(6, 5, 0, ANY_ID), rev))
+       else if (adreno_cmp_rev(ADRENO_REV(6, 5, 0, ANY_ID), rev))
                val = a650_get_speed_bin(fuse);
 
        if (val == UINT_MAX) {