Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2924787lqp; Mon, 25 Mar 2024 13:15:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWmaor072QSYz1i+RkAzX0iR1BIxSTHd5w3mhpu0pYq4duMM7nqXx8odSRHQy2gCfgLAgJ+ep9jo8i3BMs+TSkvnUcka2CDS1GnW4cT/w== X-Google-Smtp-Source: AGHT+IG/AwuQvypS6N+rfXDW6OxrbEeNP2bs4Mu2Zy7l6msthEYNHatg5wmdxCszFQNon2LIEBNB X-Received: by 2002:a0d:ce05:0:b0:60a:3ef4:29b4 with SMTP id q5-20020a0dce05000000b0060a3ef429b4mr6466586ywd.38.1711397725920; Mon, 25 Mar 2024 13:15:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711397725; cv=pass; d=google.com; s=arc-20160816; b=rS12Rnz2DpH09OGWXEQwvzhfR+JPYEruVuDmPH0upsRMrSl9PaKFO3ykTTL2zk4aeH kTzpMeANRcVX0azSqxykxpKNNpqvSgu7Wxq8REOaHpx5kCJNlUSYggemJhbnAmEAPZv3 NaXC0gSzdBzG7MBrXH5vhRuZwxtzF+VPGgSH0PUYMx6HP9Gix87M7WZLgFksFX175QYE rMkn8DYRWByf3qk+MK4stfcNlFqdqzIpQoQ0qS1QS6cu1ZSxSKVAfi537uFLKGUnPq0O F5VTHS5dAgIfHT5LN+pV5scwf0Eg4EJLgJbqNTc7uNY5U4T7s+OQQK2KAH6gh/PcWQA5 5LhA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=crTIb98cNl+zIlgW+5vvYUir0L3WIPrXhLOuIX0mPI4=; fh=EgJ5CAHvPR6mEcRxmP1/zq7uJ8Q9F4pHunCamhhT6XY=; b=c4quk9sf7bFDsTs51ErxhTuMBExscVvs7u0K1F2dWHliqaSCQ8MmkAWqokwQYbdW1a 6ifVSz8+nv/WtHltR8I1oiRvmmwVDC6rOosw2x3JvL6o62r5/wn2XR8cxgjLYzqcGatA +glyft3+xvvjuTJJb2MccbB00UinhXcvubQlBFRslSmE+Og3RHXxy2ZMy7PBnn4rAGWF VK80zK9uHxu1VKfr+TkGl1OwNux+2qB42i7mafEbD2x3iAQx0AQoqP6tE9dnJWiAoH3v XDscQlcWZ/n5cLH0ojNjvMH/BHOiSTna1u+u6PFywA0BI50o1WJo8wz73P8rApTOcQrK x+2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=MwMV+aMl; arc=pass (i=1 spf=pass spfdomain=ispras.ru dkim=pass dkdomain=ispras.ru dmarc=pass fromdomain=ispras.ru); spf=pass (google.com: domain of linux-kernel+bounces-117903-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117903-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n23-20020ae9c317000000b00789c65bc24bsi5999863qkg.724.2024.03.25.13.15.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 13:15:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117903-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=MwMV+aMl; arc=pass (i=1 spf=pass spfdomain=ispras.ru dkim=pass dkdomain=ispras.ru dmarc=pass fromdomain=ispras.ru); spf=pass (google.com: domain of linux-kernel+bounces-117903-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117903-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A16B31C62925 for ; Mon, 25 Mar 2024 20:15:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92F7157321; Mon, 25 Mar 2024 20:13:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b="MwMV+aMl" Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA9244501F for ; Mon, 25 Mar 2024 20:13:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.149.199.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711397584; cv=none; b=EzjMcs8HgZUydaO80uDBpokP8ATCna3yw+I9X8pwrOrIWhwJQSOJmBi/wB27kpnvwf5QsKVNq9/0ZGuvCekTg0J1K74d/tfbP/Y2dB4EWZPtv3HlIO7WD+p7WZ/aW4tprqC1maVw4U6J5JSpwRUNRu875Tnp0uQPVZdG0VF20fk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711397584; c=relaxed/simple; bh=v0HPfErSBVJprZR5gRdA6DB5OkU3LBe8NZkysuBx5l0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mtaQHhJE+y7LDrX06Oub+USFnl+h1yvCCE2KiJNCcmhwqrj2PXic8lDWFRDqBEnur+rvBA1hAYvftw8iRxDBZfA+pfqUF7PXDDdZXHmsfaG47A2+7WcN9FEJRoc7hCEyjvYEGzhozDVNh4nq+jv8JYBGaMMomKXHgM/lQ4jqDLs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru; spf=pass smtp.mailfrom=ispras.ru; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b=MwMV+aMl; arc=none smtp.client-ip=83.149.199.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ispras.ru Received: from tundra.lovozera (unknown [31.173.84.243]) by mail.ispras.ru (Postfix) with ESMTPSA id DCBBB40B2784; Mon, 25 Mar 2024 20:12:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru DCBBB40B2784 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1711397574; bh=crTIb98cNl+zIlgW+5vvYUir0L3WIPrXhLOuIX0mPI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MwMV+aMl4l33qBNIFmoL0MvQd9pKtZOP4n65eTqFxnWyS4Cppu5cvgqik0FjNumnv S93QePlMOz8pRdRMtUEIpqtIMabtJ9bdHYX5YpbCAO5cU2LOtWYqtMmHUPFjH5t3bV /souhdKdFlFsr9DNvI1AOKSIkn/fBki9RB6ZQy7g= From: Mikhail Kobuk To: Miquel Raynal Cc: Mikhail Kobuk , Vinod Koul , Kishon Vijay Abraham I , =?UTF-8?q?Pali=20Roh=C3=A1r?= , =?UTF-8?q?Marek=20Beh=C3=BAn?= , linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, Alexey Khoroshilov Subject: [PATCH v2 2/2] phy: marvell: a3700-comphy: Fix hardcoded array size Date: Mon, 25 Mar 2024 23:12:50 +0300 Message-ID: <20240325201254.54445-3-m.kobuk@ispras.ru> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240325201254.54445-1-m.kobuk@ispras.ru> References: <20240325201254.54445-1-m.kobuk@ispras.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Replace hardcoded 'gbe_phy_init' array size with defined value. Fixes: 934337080c6c ("phy: marvell: phy-mvebu-a3700-comphy: Add native kernel implementation") Signed-off-by: Mikhail Kobuk --- drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c index 68710ad1ad70..5d6dccfca1fb 100644 --- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c +++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c @@ -43,6 +43,7 @@ #define COMPHY_LANE_REG_DIRECT(reg) (((reg) & 0x7FF) << 1) /* COMPHY registers */ +#define COMPHY_GBE_PHY_MAX_REGS 512 #define COMPHY_POWER_PLL_CTRL 0x01 #define PU_IVREF_BIT BIT(15) #define PU_PLL_BIT BIT(14) @@ -296,7 +297,7 @@ static struct gbe_phy_init_data_fix gbe_phy_init_fix[] = { }; /* 40M1G25 mode init data */ -static u16 gbe_phy_init[512] = { +static u16 gbe_phy_init[COMPHY_GBE_PHY_MAX_REGS] = { /* 0 1 2 3 4 5 6 7 */ /*-----------------------------------------------------------*/ /* 8 9 A B C D E F */ @@ -603,7 +604,7 @@ static void comphy_gbe_phy_init(struct mvebu_a3700_comphy_lane *lane, u16 val; fix_idx = 0; - for (addr = 0; addr < 512; addr++) { + for (addr = 0; addr < COMPHY_GBE_PHY_MAX_REGS; addr++) { /* * All PHY register values are defined in full for 3.125Gbps * SERDES speed. The values required for 1.25 Gbps are almost -- 2.44.0