summaryrefslogtreecommitdiff
path: root/drivers/phy/marvell
diff options
context:
space:
mode:
authorMikhail Kobuk <m.kobuk@ispras.ru>2024-03-21 19:47:31 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-05-02 17:32:48 +0300
commit73e4d4f6f7e23b8f1713f2d851dc8e484aa6ea42 (patch)
tree2e874633c56223988fd1a3bb4ab172aef0843221 /drivers/phy/marvell
parent610f175d2e16fb2436ba7974b990563002c20d07 (diff)
downloadlinux-73e4d4f6f7e23b8f1713f2d851dc8e484aa6ea42.tar.xz
phy: marvell: a3700-comphy: Fix hardcoded array size
[ Upstream commit 627207703b73615653eea5ab7a841d5b478d961e ] Replace hardcoded 'gbe_phy_init' array size by explicit one. Fixes: 934337080c6c ("phy: marvell: phy-mvebu-a3700-comphy: Add native kernel implementation") Signed-off-by: Mikhail Kobuk <m.kobuk@ispras.ru> Link: https://lore.kernel.org/r/20240321164734.49273-2-m.kobuk@ispras.ru Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/phy/marvell')
-rw-r--r--drivers/phy/marvell/phy-mvebu-a3700-comphy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
index e2d0bf92a9ad..27f221a0f922 100644
--- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
+++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
@@ -603,7 +603,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 < ARRAY_SIZE(gbe_phy_init); addr++) {
/*
* All PHY register values are defined in full for 3.125Gbps
* SERDES speed. The values required for 1.25 Gbps are almost