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]
Date:   Sun, 19 Dec 2021 11:58:29 -0800
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Luiz Angelo Daros de Luca <luizluca@...il.com>,
        netdev@...r.kernel.org
Cc:     linus.walleij@...aro.org, andrew@...n.ch, vivien.didelot@...il.com,
        olteanv@...il.com, alsi@...g-olufsen.dk, arinc.unal@...nc9.com
Subject: Re: [PATCH net-next v2 06/13] net: dsa: realtek: use phy_read in
 ds->ops



On 12/18/2021 12:14 AM, Luiz Angelo Daros de Luca wrote:
> The ds->ops->phy_read will only be used if the ds->slave_mii_bus
> was not initialized. Calling realtek_smi_setup_mdio will create a
> ds->slave_mii_bus, making ds->ops->phy_read dormant.
> 
> Using ds->ops->phy_read will allow switches connected through non-SMI
> interfaces (like mdio) to let ds allocate slave_mii_bus and reuse the
> same code.
> 
> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
> Tested-by: Arınç ÜNAL <arinc.unal@...nc9.com>
> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@...il.com>
> ---
>   drivers/net/dsa/realtek/realtek-smi.c |  8 ++++----
>   drivers/net/dsa/realtek/realtek.h     |  3 ---
>   drivers/net/dsa/realtek/rtl8365mb.c   | 10 ++++++----
>   drivers/net/dsa/realtek/rtl8366rb.c   | 10 ++++++----
>   4 files changed, 16 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/net/dsa/realtek/realtek-smi.c b/drivers/net/dsa/realtek/realtek-smi.c
> index 351df8792ab3..32690bd28128 100644
> --- a/drivers/net/dsa/realtek/realtek-smi.c
> +++ b/drivers/net/dsa/realtek/realtek-smi.c
> @@ -328,17 +328,17 @@ static const struct regmap_config realtek_smi_mdio_regmap_config = {
>   
>   static int realtek_smi_mdio_read(struct mii_bus *bus, int addr, int regnum)
>   {
> -	struct realtek_priv *priv = bus->priv;
> +	struct dsa_switch *ds = ((struct realtek_priv *)bus->priv)->ds;

No need to cast a void pointer, this applies throughout the entire patch 
series.
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ