Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp672236pxb; Tue, 5 Apr 2022 18:10:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgWCGLbBuaF39c0wquKGKEaH8oZnU+FSUN2MnR3ay4ieyzgXUF4rQ66Rr1FA4qAz35JQg8 X-Received: by 2002:a17:906:c103:b0:6e0:df50:7f52 with SMTP id do3-20020a170906c10300b006e0df507f52mr6113219ejc.501.1649207435854; Tue, 05 Apr 2022 18:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649207435; cv=none; d=google.com; s=arc-20160816; b=pFj2YPwlcQsAp6ESVrsVl6X2QgsCZo1UX1qZcOYA3QvF5mDRXt5okqI9oqyps4EvWU NYk8WtBsDbWSnekcVSbAYun5xiNCGw59fkHTk9c1bHZccMu4HkRyNL5FYK1WWBbpOBbd 6G64VltUHj3TeHRIvJJe6mSf2uncgWR03Zjn4/nviIvJs7kWJ930unGvCFRk08OaiAZn a0N1DHBxCn4aqMxMUnHWcNb9lBFNvEccDmreW/+kGbLF1Z8uHaJj5Oxo7XMrJARetq7H lhkqgr1ylTkjoocTfovMndMsCo7dp1/FOEUr1c7PZZNztbcDCnSSEPhCZ63wCAUT0PTl K4rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JHNrX5cMfi9LvlI76ktp7E5xQIG4e9q7YtA/2htRnow=; b=yjPhU9C20ZzXFTFl+MJ9EBiQNXpK2gxlpbSKGEBe1jXURxPQ6lU4734DD1IVIbprzJ c4CdTAygX5FRc7iEUfcdWRcGRpd68nToDM2jyr/MH7MgmtBxZkD+R0TJb1XOqKDCcSSF F90gLl1+19wADMAFZDdDozDxUlJ8YyfmWG7zpqFq5Zu6C0DvhVzQOKFlVNbyRGBeYy2K jlmqRCmKoUz++Ok4HM8D6jagPnqenFw7Dh/jmCl3x1yhKmoUTz5D+msYtr/T/zg5OXvP AsjBivD9lwoL1ytrgBpp2pNYtHkON+JFQNex+KuGQ/L0MpgS+kzOaayJHbGgda5QlGfx Kw+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dtySrJGr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m13-20020a50998d000000b0041cf3b1bffdsi375281edb.261.2022.04.05.18.10.11; Tue, 05 Apr 2022 18:10:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dtySrJGr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343762AbiDEJlu (ORCPT + 99 others); Tue, 5 Apr 2022 05:41:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238967AbiDEITd (ORCPT ); Tue, 5 Apr 2022 04:19:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24F2275C38; Tue, 5 Apr 2022 01:09:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D887DB81B90; Tue, 5 Apr 2022 08:09:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37CC5C385A0; Tue, 5 Apr 2022 08:09:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649146193; bh=+EkYPM/9VSMLeOdGLvUk8BbpTJ3vtgGT8IT5amiLLb0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dtySrJGr6y5zD7e104cetnnJTzLWuJ7lx1rVolHLJvALwVi5oW69iAjEk0edvHXk/ BVpc8srD8f2AWoC0T6TWdl2VWb+r5M67E9YjbIVO2KJZ6sn1uYHtrF9eNYRH91pSU4 UDjJxM+2450f/6dt2TP9tOQYllKGijIRtv/MjVTs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Clark , Dmitry Baryshkov , Sasha Levin Subject: [PATCH 5.17 0637/1126] drm/msm/a6xx: Fix missing ARRAY_SIZE() check Date: Tue, 5 Apr 2022 09:23:04 +0200 Message-Id: <20220405070426.333993833@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Clark [ Upstream commit cca96584b35765bf9eb5f38ca55a144ea2ba0de4 ] Fixes: f6d62d091cfd ("drm/msm/a6xx: add support for Adreno 660 GPU") Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220305173405.914989-1-robdclark@gmail.com Signed-off-by: Sasha Levin --- 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 17cfad6424db..616be7265da4 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -655,19 +655,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); } /* -- 2.34.1