mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 15:15:47 +00:00
drm/msm/a6xx: Fix missing ARRAY_SIZE() check
[ Upstream commitcca96584b3
] Fixes:f6d62d091c
("drm/msm/a6xx: add support for Adreno 660 GPU") Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20220305173405.914989-1-robdclark@gmail.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
62f44f554d
commit
f23b4c9c6a
1 changed files with 8 additions and 4 deletions
|
@ -658,19 +658,23 @@ static void a6xx_set_cp_protect(struct msm_gpu *gpu)
|
|||
{
|
||||
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
|
||||
const u32 *regs = a6xx_protect;
|
||||
unsigned i, count = ARRAY_SIZE(a6xx_protect), count_max = 32;
|
||||
|
||||
BUILD_BUG_ON(ARRAY_SIZE(a6xx_protect) > 32);
|
||||
BUILD_BUG_ON(ARRAY_SIZE(a650_protect) > 48);
|
||||
unsigned i, count, count_max;
|
||||
|
||||
if (adreno_is_a650(adreno_gpu)) {
|
||||
regs = a650_protect;
|
||||
count = ARRAY_SIZE(a650_protect);
|
||||
count_max = 48;
|
||||
BUILD_BUG_ON(ARRAY_SIZE(a650_protect) > 48);
|
||||
} else if (adreno_is_a660_family(adreno_gpu)) {
|
||||
regs = a660_protect;
|
||||
count = ARRAY_SIZE(a660_protect);
|
||||
count_max = 48;
|
||||
BUILD_BUG_ON(ARRAY_SIZE(a660_protect) > 48);
|
||||
} else {
|
||||
regs = a6xx_protect;
|
||||
count = ARRAY_SIZE(a6xx_protect);
|
||||
count_max = 32;
|
||||
BUILD_BUG_ON(ARRAY_SIZE(a6xx_protect) > 32);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue