19 Apr
2021
19 Apr
'21
5:08 p.m.
On Mon, Apr 19, 2021 at 04:51:42PM +0200, Thierry Reding wrote:
Reducing from 128 to, say, 80 should eliminate that warning, but I wonder if perhaps a better solution for the longer term would be to allocate this structure on the heap rather than on the stack? That way we don't risk triggering this warning again in the future.
The data structure seems to be only used during initialization, so something like a kzalloc()/kfree() pair doesn't seem like it would hurt much performance-wise. Add in the devm_ variants and the code complexity should also remain moderately low.
Yes, that'd be much better - ideally we wouldn't have a fixed limit of any kind but that's a more involved change and quite possibly more trouble than it's worth.