lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240322082645.6c1d43b5@xps-13>
Date: Fri, 22 Mar 2024 08:26:45 +0100
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Mikhail Kobuk <m.kobuk@...ras.ru>
Cc: Vinod Koul <vkoul@...nel.org>, Kishon Vijay Abraham I
 <kishon@...nel.org>, Marek Behún <kabel@...nel.org>, Pali
 Rohár <pali@...nel.org>, linux-phy@...ts.infradead.org,
 linux-kernel@...r.kernel.org, lvc-project@...uxtesting.org, Alexey
 Khoroshilov <khoroshilov@...ras.ru>
Subject: Re: [PATCH 2/2] phy: marvell: a3700-comphy: Fix hardcoded array
 size

Hi Mikhail,

m.kobuk@...ras.ru wrote on Thu, 21 Mar 2024 19:47:31 +0300:

> 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@...ras.ru>
> ---
>  drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c
> index 41162d7228c9..15bf10710de0 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

512 is also used where gbe_phy_init is defined, so maybe it would be
worthe defining this size once and then use the definition in both
places.

Thanks, Miquèl

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ