Re: [PATCH][next] optee: make read-only array attr static const

From: Dan Carpenter

Date: Mon Jan 12 2026 - 10:15:23 EST


On Mon, Jan 12, 2026 at 04:56:10PM +0530, Sumit Garg wrote:
> On Fri, Jan 09, 2026 at 03:44:42PM +0000, Colin Ian King wrote:
> > Don't populate the read-only array attr on the stack at run
> > time, instead make it static const.
>
> Is there any value add to do this? AFAIK, the static local variables
> aren't preffered.
>

I have never heard that static local variables aren't prefered. I
imagine that because they're often not thread safe? But if they're
const thread safeness isn't an problem. Generally, we prefer the
scope as local as possible.

regards,
dan carpenter