[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <807aa02ed3d54c2f9b31343e19df91526cc3c14e.camel@microchip.com>
Date: Tue, 30 Mar 2021 15:59:55 +0200
From: Steen Hegelund <steen.hegelund@...rochip.com>
To: Andrew Lunn <andrew@...n.ch>
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
Hi Andrew,
On Tue, 2021-03-30 at 15:34 +0200, Andrew Lunn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> > > > +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
> >
> > No it still counts against the stack even as a const structure.
>
> I'm surprised. Maybe it needs static as well?
>
> I'm just thinking you can get a much smaller patch if you don't need
> to modify the table, just add additional qualifiers.
>
> Andrew
I get your point, but the problem is that the initialization depends on the input parameters: serdes
index, port index, media type, speed etc, so it cannot be made static, and making it const still
uses the stack.
BR
Steen
Powered by blists - more mailing lists