]> 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)
commit2d2bc4115578b6e889a05aacbd7a207bc4631bd1
treedafe3b1e03506fbbb1add204cf2ea4a69ac5a62c
parent13f1167f6a6f68e67b7c1eb6217375ec50e9b5b3
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