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: <YGIimz9UnVYWfcXH@lunn.ch>
Date:   Mon, 29 Mar 2021 20:55:23 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Steen Hegelund <steen.hegelund@...rochip.com>
Cc:     Kishon Vijay Abraham I <kishon@...com>,
        Vinod Koul <vkoul@...nel.org>,
        linux-arm-kernel@...ts.infradead.org,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Microchip UNG Driver List <UNGLinuxDriver@...rochip.com>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel test robot <lkp@...el.com>
Subject: Re: [PATCH linux-next 1/1] phy: Sparx5 Eth SerDes: Use direct
 register operations

On Mon, Mar 29, 2021 at 10:14:38AM +0200, Steen Hegelund wrote:
> Use direct register operations instead of a table of register
> information to lower the stack usage.
> 
> Signed-off-by: Steen Hegelund <steen.hegelund@...rochip.com>
> Reported-by: kernel test robot <lkp@...el.com>
> ---
>  drivers/phy/microchip/sparx5_serdes.c | 1869 +++++++++++++------------
>  1 file changed, 951 insertions(+), 918 deletions(-)
> 
> diff --git a/drivers/phy/microchip/sparx5_serdes.c b/drivers/phy/microchip/sparx5_serdes.c
> index 06bcf0c166cf..43de68a62c2f 100644
> --- a/drivers/phy/microchip/sparx5_serdes.c
> +++ b/drivers/phy/microchip/sparx5_serdes.c
> @@ -343,12 +343,6 @@ struct sparx5_sd10g28_params {
>  	u8 fx_100;
>  };
>  
> -struct sparx5_serdes_regval {
> -	u32 value;
> -	u32 mask;
> -	void __iomem *addr;
> -};
> -
>  static struct sparx5_sd25g28_media_preset media_presets_25g[] = {
>  	{ /* ETH_MEDIA_DEFAULT */
>  		.cfg_en_adv               = 0,
> @@ -945,431 +939,411 @@ static void sparx5_sd25g28_reset(void __iomem *regs[],
>  	}
>  }
>  
> -static int sparx5_sd25g28_apply_params(struct device *dev,
> -				       void __iomem *regs[],
> -				       struct sparx5_sd25g28_params *params,
> -				       u32 sd_index)
> +static int sparx5_sd25g28_apply_params(struct sparx5_serdes_macro *macro,
> +				       struct sparx5_sd25g28_params *params)
>  {
> -	struct sparx5_serdes_regval item[] = {

Could you just add const here, and then it is no longer on the stack?

   Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ