drm/msm/dpu: Use indexed array initializer to prevent mismatches
authorMarijn Suijten <marijn.suijten@somainline.org>
Sat, 26 Feb 2022 19:46:32 +0000 (20:46 +0100)
committerRob Clark <robdclark@chromium.org>
Wed, 6 Apr 2022 16:25:09 +0000 (09:25 -0700)
commit0fe35b8dcb8b3c4b751a1a44f1e128b690af71e4
tree05be29c80abfab6a8b71002b078da0f28331f91c
parentf75e582b0c3ee8f0bddc2248cc8b9175f29c5937
drm/msm/dpu: Use indexed array initializer to prevent mismatches

While there's a comment pointing from dpu_intr_set to dpu_hw_intr_reg
and vice-versa, an array initializer using indices makes it so that the
indices between the enum and array cannot possibly get out of sync even
if they're accidentially ordered wrongly.  It is still useful to keep
the comment to be made aware where the register offset mapping resides
while looking at dpu_hw_intr_reg.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20220226194633.204501-1-marijn.suijten@somainline.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c