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)
commit94a9e05228c8624fbb08f4d8b2775dd0dc588f76
treedafe3b1e03506fbbb1add204cf2ea4a69ac5a62c
parentefc7617086bf3ce5a782fcc926947d73788316c5
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