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:   Tue, 10 Jan 2023 14:15:29 +0000
From:   <Arun.Ramadoss@...rochip.com>
To:     <andrew@...n.ch>, <yoshihiro.shimoda.uh@...esas.com>,
        <linux@...linux.org.uk>, <kuba@...nel.org>, <pabeni@...hat.com>,
        <edumazet@...gle.com>, <davem@...emloft.net>,
        <hkallweit1@...il.com>
CC:     <netdev@...r.kernel.org>, <linux-renesas-soc@...r.kernel.org>
Subject: Re: [PATCH net-next v2 2/4] net: ethernet: renesas: rswitch: Simplify
 struct phy * handling

Hi Yoshihiro,
On Tue, 2023-01-10 at 14:02 +0900, Yoshihiro Shimoda wrote:
> Simplify struct phy *serdes handling by keeping the valiable in
> the struct rswitch_device.
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
> ---
>  drivers/net/ethernet/renesas/rswitch.c | 40 ++++++++++++----------
> ----
>  drivers/net/ethernet/renesas/rswitch.h |  1 +
>  2 files changed, 19 insertions(+), 22 deletions(-)
> 
> 
>  
> -static int rswitch_serdes_set_params(struct rswitch_device *rdev)
> 
>  
>  static int rswitch_ether_port_init_one(struct rswitch_device *rdev)
> @@ -1299,6 +1290,10 @@ static int rswitch_ether_port_init_one(struct
> rswitch_device *rdev)
>  	if (err < 0)
>  		goto err_phylink_init;
>  
> +	err = rswitch_serdes_phy_get(rdev);
> +	if (err < 0)
> +		goto err_serdes_phy_get;

I think, we can use *err_serdes_set_params* instead of creating new
label err_serdes_phy_get, since the label is not doing any work.

> +
>  	err = rswitch_serdes_set_params(rdev);
>  	if (err < 0)
>  		goto err_serdes_set_params;
> @@ -1306,6 +1301,7 @@ static int rswitch_ether_port_init_one(struct
> rswitch_device *rdev)
>  	return 0;
>  
>  err_serdes_set_params:
> +err_serdes_phy_get:
>  	rswitch_phylink_deinit(rdev);
>  
>  err_phylink_init:
> diff --git a/drivers/net/ethernet/renesas/rswitch.h
> b/drivers/net/ethernet/renesas/rswitch.h
> index edbdd1b98d3d..d9a0be6666f5 100644
> --- a/drivers/net/ethernet/renesas/rswitch.h
> +++ b/drivers/net/ethernet/renesas/rswitch.h
> @@ -941,6 +941,7 @@ struct rswitch_device {
>  
>  	int port;
>  	struct rswitch_etha *etha;
> +	struct phy *serdes;
>  };
>  
>  struct rswitch_mfwd_mac_table_entry {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ