]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Sun, 1 May 2022 23:39:35 +0000 (02:39 +0300)
commit5050bd695f6d5614279a007280351262987dfebf
treeef0b4d790fc0f1739b22f679d499f6276202a1ee
parent45591e10e0779411ba0fa3f3de2f6b6ac6c42d39
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>
Patchwork: https://patchwork.freedesktop.org/patch/476358/
Link: https://lore.kernel.org/r/20220226194633.204501-1-marijn.suijten@somainline.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c