Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp666102pxb; Tue, 5 Apr 2022 17:57:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjQBnvd3pZYMI4hM13ngs9KQJyZbIbALSzVQg3QhJ54yvmlTaVPJGzzyExOWj0hhUgGkx8 X-Received: by 2002:a17:906:60c2:b0:6e7:681e:b4b7 with SMTP id f2-20020a17090660c200b006e7681eb4b7mr5999418ejk.130.1649206670057; Tue, 05 Apr 2022 17:57:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649206670; cv=none; d=google.com; s=arc-20160816; b=novxxRankDLhqCaEAVcCSkmgPCwGtnylA/tuP5gXGnC1mvM0lmXPWg9m/2t2/i0h+2 SL4SuyfoaFkKQnvHbGcZ/NFHzTDAjKoPCUzeURWhoeJJsfVDcoKQ8ttthUZlJsFoVNHW KlaJKSGA8J+u4twK7aamJYPqKCrLKVn7aOXpFq1CvOZAjmE15ZX17xSsaK+F+A7n1dry qeaWFBHsnC7Exy8XHm0PuLV4H7Twgf8iOSeK5YQER2d4pNAF1uTzwJh36EHR5245xIWC XtEMGpWyokZ2NlDyzZdMnF+jx9HHghheymPOSOPwhHvYAwwOXYlamwNIQn8Z9Q/1PmQh 5CMA== 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=enXz9kiBh0/eRDUMGNZQkkPfjeFPAWaQt534WtVHT8w=; b=o5VSyCY2w+Eoc5KA2dQdOOjuqV9CN/kKHEqtpYvmQvQvRhr9oFiDtLsgwb57FG1qpW dvpeZl4asCIqyGCaqp2tZPhZBjJGsJwSsCq0fY/5qHkkeTK2f8DTUK4gOoxYsnES1pQb J+OxdGXNZI9y59QZ4nFxqlb1Ia/79vpn92LbJ1AZpel/aZ7TkfPmzs7ZXyu3cOcj6/V9 1NyTv5X3L1/8Hgmi924JklhQYqDAINJiMWYS/EnI7D8LgkoSiG9UCSGcE9bRJ/yCISHe EzhUpi3lbpLPUWn85DnfsW+nlg1hbZoyfgI+97KvCMBpzF1afcV/a9kfimnZzmpXdxP4 lQ0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1S17TENZ; 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 x11-20020a170906148b00b006e7f1c6d99fsi5936506ejc.414.2022.04.05.17.57.21; Tue, 05 Apr 2022 17:57:50 -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=1S17TENZ; 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 S1359185AbiDEM5g (ORCPT + 99 others); Tue, 5 Apr 2022 08:57:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243024AbiDEJIg (ORCPT ); Tue, 5 Apr 2022 05:08:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC76C9136E; Tue, 5 Apr 2022 01:57:34 -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 93D3EB81C6E; Tue, 5 Apr 2022 08:57:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C219C385AF; Tue, 5 Apr 2022 08:57:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149051; bh=buYb17ZBaPoIae4E0yY0uhFDTDhV3hELVV3kLUdptVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1S17TENZQwrPuhvek+SWWjQ3pJIe0GmP8HRjM/kpiseh3ZRvy9EvzgQN3iln6VNBp 6yEwv5HDoaadg2TOqTMOO0HRqrPQZis2ySnmXWuqoQZCB43DKBMKEelAYJ/0kip2Up o1mgG4vYVs7jkB+QW4B2c6BUbA0t8tfC79bzPA+s= 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.16 0576/1017] drm/msm/a6xx: Fix missing ARRAY_SIZE() check Date: Tue, 5 Apr 2022 09:24:49 +0200 Message-Id: <20220405070411.377743319@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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 a305ff7e8c6f..f880a59a40fc 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -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); } /* -- 2.34.1