Skip to content

Commit 5b06195

Browse files
superna9999robclark
authored andcommitted
drm/msm: adreno: add defines for gpu & gmu frequency table sizes
Even if the code uses ARRAY_SIZE() to fill those tables, it's still a best practice to not use magic values for tables in structs. Suggested-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Akhil P Oommen <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/629393/ Signed-off-by: Rob Clark <[email protected]>
1 parent 280807d commit 5b06195

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/gpu/drm/msm/adreno/a6xx_gmu.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ struct a6xx_gmu_bo {
1919
u64 iova;
2020
};
2121

22+
#define GMU_MAX_GX_FREQS 16
23+
#define GMU_MAX_CX_FREQS 4
24+
2225
/*
2326
* These define the different GMU wake up options - these define how both the
2427
* CPU and the GMU bring up the hardware
@@ -79,12 +82,12 @@ struct a6xx_gmu {
7982
int current_perf_index;
8083

8184
int nr_gpu_freqs;
82-
unsigned long gpu_freqs[16];
83-
u32 gx_arc_votes[16];
85+
unsigned long gpu_freqs[GMU_MAX_GX_FREQS];
86+
u32 gx_arc_votes[GMU_MAX_GX_FREQS];
8487

8588
int nr_gmu_freqs;
86-
unsigned long gmu_freqs[4];
87-
u32 cx_arc_votes[4];
89+
unsigned long gmu_freqs[GMU_MAX_CX_FREQS];
90+
u32 cx_arc_votes[GMU_MAX_CX_FREQS];
8891

8992
unsigned long freq;
9093

0 commit comments

Comments
 (0)