Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1546518pxb; Sat, 16 Oct 2021 12:49:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBTnxDevtKx0Vm9eSf+AM6igp5tivC/2ILOQLS+HrTXDinWOdTFDcarHVQl9utjBrNzGmy X-Received: by 2002:a05:6a00:1703:b0:44c:caeb:482b with SMTP id h3-20020a056a00170300b0044ccaeb482bmr18839278pfc.60.1634413783675; Sat, 16 Oct 2021 12:49:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634413783; cv=none; d=google.com; s=arc-20160816; b=Eb+qTlLivwv0KRLB/211fBhsgqs0oCZ8cV/DmWKkFTr7A7/C/ksK7qZnPfeIRvQHeX Mb+V+eMtIjmFAuSbHTFjpEhFxKKUM3omH//hVhQ2mcxv2o2ZepZmwEto9nznQxSF/ZOj s1di/nG0QnevWGIiZvAwMqqVJ70J+bHDtnxhK0m/nsNb17vmvgC9in0RZRc46yZ9fppK BLOXz3SIQsaFqXjyFYqxcn39BZCPu0ilw831SVB/9J4ZVmka459TwRoo3I5c3tjiuaDO +rlbQhKBIgFG9BVOA85LLIZraPSl22dLZCNT0KO31bqVPlSakUJmIskPUjE3KnfINzKm R/SQ== 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 :message-id:date:subject:cc:to:from; bh=cnszi26ThQ/yBCLElgyojQt94cKgsePdZxmXayfeN4A=; b=HGh6HHUGpODzEXAdvLc5qsJxv82oHbM1o5AJOoRTwvmwBVPrsj0PzpgWtrqkU2e4/u yovTOod3jS/i13YNMm59aVVnQjAcs2OMCxdNUPibmMSiDHPUbh1JpC2nZwI0qONA3jy6 /bgUuRyc/1ZHo2Ckfv/AY2IDLHe8gfXowaInjWDW4iVFZZq2JT2BNkVZvfBk/oFjCqat r8jTyyaEbPQ0bpBXOMTlfBkKixgc7CvRG6Bcun/g+IvceylacN6KxmX2GMy/oCx3JL1N XqJ6BjAvPsGomjKTi2eoS3eDw4Xtjhcpbty9cuk94MYNo1omMw3U9XTdRnu7KntyhzQT HTpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g74si6231212pfb.46.2021.10.16.12.48.58; Sat, 16 Oct 2021 12:49:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240901AbhJOPSZ (ORCPT + 99 others); Fri, 15 Oct 2021 11:18:25 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:35682 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234126AbhJOPSX (ORCPT ); Fri, 15 Oct 2021 11:18:23 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id 6FEF21F45433 From: AngeloGioacchino Del Regno To: krzysztof.kozlowski@canonical.com Cc: yong.wu@mediatek.com, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno Subject: [PATCH] memory: mtk-smi: Use ARRAY_SIZE to define MTK_SMI_CLK_NR_MAX Date: Fri, 15 Oct 2021 17:15:57 +0200 Message-Id: <20211015151557.510726-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This definition is tied to the number of SMI common clocks (the array mtk_smi_common_clks): improve the definition by using the ARRAY_SIZE macro instead. That will also reduce room for mistakes when updating the aforementioned array in the future. Signed-off-by: AngeloGioacchino Del Regno --- drivers/memory/mtk-smi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index b883dcc0bbfa..6331422141e8 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -94,8 +94,6 @@ enum mtk_smi_type { MTK_SMI_GEN2_SUB_COMM, /* gen2 smi sub common */ }; -#define MTK_SMI_CLK_NR_MAX 4 - /* larbs: Require apb/smi clocks while gals is optional. */ static const char * const mtk_smi_larb_clks[] = {"apb", "smi", "gals"}; #define MTK_SMI_LARB_REQ_CLK_NR 2 @@ -106,6 +104,7 @@ static const char * const mtk_smi_larb_clks[] = {"apb", "smi", "gals"}; * sub common: Require apb/smi/gals0 clocks in has_gals case. Otherwise, only apb/smi are required. */ static const char * const mtk_smi_common_clks[] = {"apb", "smi", "gals0", "gals1"}; +#define MTK_SMI_CLK_NR_MAX ARRAY_SIZE(mtk_smi_common_clks) #define MTK_SMI_COM_REQ_CLK_NR 2 #define MTK_SMI_COM_GALS_REQ_CLK_NR MTK_SMI_CLK_NR_MAX #define MTK_SMI_SUB_COM_GALS_REQ_CLK_NR 3 -- 2.33.0