]> git.baikalelectronics.ru Git - kernel.git/commit
drm/msm/dp: use ARRAY_SIZE for calculating num_descs
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Mon, 27 Jun 2022 16:54:13 +0000 (19:54 +0300)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Mon, 4 Jul 2022 18:05:29 +0000 (21:05 +0300)
commit65c51fa3e4e683e6cb20e4df8eaac8612221a902
treedafe3b1e03506fbbb1add204cf2ea4a69ac5a62c
parent9adaff7846a3ca61b03967ad57a93f7ef7ea02ff
drm/msm/dp: use ARRAY_SIZE for calculating num_descs

If for some reason the msm_dp_config::descs array starts from non-zero
index or contains the hole, setting the msm_dp_config::num_descs might
be not that obvious and error-prone. Use ARRAY_SIZE to set this field
rather than encoding the value manually.

Reported-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/491399/
Link: https://lore.kernel.org/r/20220627165413.657142-1-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/dp/dp_display.c