lkml.org 
[lkml]   [2023]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH v7 15/18] drm/msm/a6xx: Use "else if" in GPU speedbin rev matching
    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>
    Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
    ---
    drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 8 ++++----
    1 file changed, 4 insertions(+), 4 deletions(-)

    diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
    index 9f296928c249..99bb3d16657a 100644
    --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
    +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
    @@ -2174,16 +2174,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) {
    --
    2.40.1

    \
     
     \ /
      Last update: 2023-05-20 14:23    [W:5.919 / U:0.128 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site