Skip to content

Commit 0fe35b8

Browse files
MarijnS95robclark
authored andcommitted
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>
1 parent f75e582 commit 0fe35b8

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,87 +54,87 @@ struct dpu_intr_reg {
5454
* When making changes be sure to sync with dpu_hw_intr_reg
5555
*/
5656
static const struct dpu_intr_reg dpu_intr_set[] = {
57-
{
57+
[MDP_SSPP_TOP0_INTR] = {
5858
MDP_SSPP_TOP0_OFF+INTR_CLEAR,
5959
MDP_SSPP_TOP0_OFF+INTR_EN,
6060
MDP_SSPP_TOP0_OFF+INTR_STATUS
6161
},
62-
{
62+
[MDP_SSPP_TOP0_INTR2] = {
6363
MDP_SSPP_TOP0_OFF+INTR2_CLEAR,
6464
MDP_SSPP_TOP0_OFF+INTR2_EN,
6565
MDP_SSPP_TOP0_OFF+INTR2_STATUS
6666
},
67-
{
67+
[MDP_SSPP_TOP0_HIST_INTR] = {
6868
MDP_SSPP_TOP0_OFF+HIST_INTR_CLEAR,
6969
MDP_SSPP_TOP0_OFF+HIST_INTR_EN,
7070
MDP_SSPP_TOP0_OFF+HIST_INTR_STATUS
7171
},
72-
{
72+
[MDP_INTF0_INTR] = {
7373
MDP_INTF_0_OFF+INTF_INTR_CLEAR,
7474
MDP_INTF_0_OFF+INTF_INTR_EN,
7575
MDP_INTF_0_OFF+INTF_INTR_STATUS
7676
},
77-
{
77+
[MDP_INTF1_INTR] = {
7878
MDP_INTF_1_OFF+INTF_INTR_CLEAR,
7979
MDP_INTF_1_OFF+INTF_INTR_EN,
8080
MDP_INTF_1_OFF+INTF_INTR_STATUS
8181
},
82-
{
82+
[MDP_INTF2_INTR] = {
8383
MDP_INTF_2_OFF+INTF_INTR_CLEAR,
8484
MDP_INTF_2_OFF+INTF_INTR_EN,
8585
MDP_INTF_2_OFF+INTF_INTR_STATUS
8686
},
87-
{
87+
[MDP_INTF3_INTR] = {
8888
MDP_INTF_3_OFF+INTF_INTR_CLEAR,
8989
MDP_INTF_3_OFF+INTF_INTR_EN,
9090
MDP_INTF_3_OFF+INTF_INTR_STATUS
9191
},
92-
{
92+
[MDP_INTF4_INTR] = {
9393
MDP_INTF_4_OFF+INTF_INTR_CLEAR,
9494
MDP_INTF_4_OFF+INTF_INTR_EN,
9595
MDP_INTF_4_OFF+INTF_INTR_STATUS
9696
},
97-
{
97+
[MDP_INTF5_INTR] = {
9898
MDP_INTF_5_OFF+INTF_INTR_CLEAR,
9999
MDP_INTF_5_OFF+INTF_INTR_EN,
100100
MDP_INTF_5_OFF+INTF_INTR_STATUS
101101
},
102-
{
102+
[MDP_AD4_0_INTR] = {
103103
MDP_AD4_0_OFF + MDP_AD4_INTR_CLEAR_OFF,
104104
MDP_AD4_0_OFF + MDP_AD4_INTR_EN_OFF,
105105
MDP_AD4_0_OFF + MDP_AD4_INTR_STATUS_OFF,
106106
},
107-
{
107+
[MDP_AD4_1_INTR] = {
108108
MDP_AD4_1_OFF + MDP_AD4_INTR_CLEAR_OFF,
109109
MDP_AD4_1_OFF + MDP_AD4_INTR_EN_OFF,
110110
MDP_AD4_1_OFF + MDP_AD4_INTR_STATUS_OFF,
111111
},
112-
{
112+
[MDP_INTF0_7xxx_INTR] = {
113113
MDP_INTF_0_OFF_REV_7xxx+INTF_INTR_CLEAR,
114114
MDP_INTF_0_OFF_REV_7xxx+INTF_INTR_EN,
115115
MDP_INTF_0_OFF_REV_7xxx+INTF_INTR_STATUS
116116
},
117-
{
117+
[MDP_INTF1_7xxx_INTR] = {
118118
MDP_INTF_1_OFF_REV_7xxx+INTF_INTR_CLEAR,
119119
MDP_INTF_1_OFF_REV_7xxx+INTF_INTR_EN,
120120
MDP_INTF_1_OFF_REV_7xxx+INTF_INTR_STATUS
121121
},
122-
{
122+
[MDP_INTF2_7xxx_INTR] = {
123123
MDP_INTF_2_OFF_REV_7xxx+INTF_INTR_CLEAR,
124124
MDP_INTF_2_OFF_REV_7xxx+INTF_INTR_EN,
125125
MDP_INTF_2_OFF_REV_7xxx+INTF_INTR_STATUS
126126
},
127-
{
127+
[MDP_INTF3_7xxx_INTR] = {
128128
MDP_INTF_3_OFF_REV_7xxx+INTF_INTR_CLEAR,
129129
MDP_INTF_3_OFF_REV_7xxx+INTF_INTR_EN,
130130
MDP_INTF_3_OFF_REV_7xxx+INTF_INTR_STATUS
131131
},
132-
{
132+
[MDP_INTF4_7xxx_INTR] = {
133133
MDP_INTF_4_OFF_REV_7xxx+INTF_INTR_CLEAR,
134134
MDP_INTF_4_OFF_REV_7xxx+INTF_INTR_EN,
135135
MDP_INTF_4_OFF_REV_7xxx+INTF_INTR_STATUS
136136
},
137-
{
137+
[MDP_INTF5_7xxx_INTR] = {
138138
MDP_INTF_5_OFF_REV_7xxx+INTF_INTR_CLEAR,
139139
MDP_INTF_5_OFF_REV_7xxx+INTF_INTR_EN,
140140
MDP_INTF_5_OFF_REV_7xxx+INTF_INTR_STATUS

0 commit comments

Comments
 (0)