[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <81e33d86-74f4-fead-a77e-aab5c2059996@quicinc.com>
Date: Mon, 7 Mar 2022 20:33:01 +0530
From: Akhil P Oommen <quic_akhilpo@...cinc.com>
To: Rob Clark <robdclark@...il.com>, <dri-devel@...ts.freedesktop.org>
CC: <freedreno@...ts.freedesktop.org>, <linux-arm-msm@...r.kernel.org>,
"Rob Clark" <robdclark@...omium.org>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Sean Paul <sean@...rly.run>,
Abhinav Kumar <quic_abhinavk@...cinc.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Jonathan Marek <jonathan@...ek.ca>,
Jordan Crouse <jordan@...micpenguin.net>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/msm/a6xx: Fix missing ARRAY_SIZE() check
On 3/5/2022 11:04 PM, Rob Clark wrote:
> From: Rob Clark <robdclark@...omium.org>
>
> Fixes: f6d62d091cfd ("drm/msm/a6xx: add support for Adreno 660 GPU")
> Signed-off-by: Rob Clark <robdclark@...omium.org>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
> ---
> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> index 02b47977b5c3..83c31b2ad865 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> @@ -683,19 +683,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);
> }
>
> /*
Reviewed-by: Akhil P Oommen <quic_akhilpo@...cinc.com>
-Akhil.
Powered by blists - more mailing lists